@import url(https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=Noto+Serif+SC:wght@400;500;700;800&display=swap);
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --bg-0: #0f1012;
  --bg-1: #17171b;
  --bg-2: #201c1b;
  --panel: rgba(24, 22, 25, 0.9);
  --card: rgba(43, 35, 36, 0.88);
  --gold: #d2ab63;
  --silver: #d1d5dc;
  --red: #8e2a32;
  --attribute-base: #d1d5dc;
  --attribute-highest: #d2ab63;
  --text-main: #f2ede4;
  --text-soft: #c7beb1;
  --text-dim: #9b8e80;
  --text-hi: #f2ede4;
  --text-mute: #9b8e80;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Crimson Text', 'Noto Serif SC', 'Times New Roman', serif;
  color: var(--text-main);
  background: radial-gradient(
      circle at 12% 12%,
      rgba(142, 42, 50, 0.16),
      transparent 24%
    ),
    radial-gradient(
      circle at 88% 18%,
      rgba(210, 171, 99, 0.09),
      transparent 20%
    ), linear-gradient(135deg, #101114 0%, #151519 52%, #0c0d0f 100%);
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
}

p {
  margin: 0;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
}

.texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.texture-a {
  background: repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0 1px,
      transparent 1px 86px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012) 0 1px,
      transparent 1px 92px
    );
  opacity: 0.38;
  mix-blend-mode: screen;
}

.texture-b {
  background: radial-gradient(
      circle at 20% 30%,
      rgba(255, 255, 255, 0.04),
      transparent 25%
    ),
    radial-gradient(
      circle at 72% 78%,
      rgba(210, 171, 99, 0.06),
      transparent 28%
    ), linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%);
}

.ui-frame {
  position: relative;
  width: min(1680px, calc(100vw - 24px));
  margin: 12px auto;
  padding: 16px;
  display: grid;
  grid-template-columns: clamp(360px, calc((100vh - 48px) * 0.56), 520px) minmax(
      0,
      1fr
    );
  gap: 16px;
  align-items: start;
}

.panel-frame {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(
      180deg,
      rgba(31, 28, 31, 0.95),
      rgba(16, 15, 18, 0.97)
    ),
    linear-gradient(135deg, rgba(210, 171, 99, 0.04), rgba(142, 42, 50, 0.04));
  border: 1px solid rgba(210, 171, 99, 0.22);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ornate-frame::before,
.ornate-frame::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(210, 171, 99, 0.08);
  border-radius: 20px;
  pointer-events: none;
}

.ornate-frame::after {
  inset: 6px;
  border-color: rgba(209, 213, 220, 0.06);
}

.left-stage {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 24px);
}

.stage-header {
  position: relative;
  padding: 22px 26px 10px;
  background: transparent;
}

.tiny-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.stage-header h1,
.hero-title {
  margin: 0;
  font-family: 'Cinzel', serif;
  line-height: 1.05;
}

.stage-header h1 {
  font-size: 46px;
}

.stage-subline {
  margin: 4px 0 0;
  font-size: 12px;
  color: #c8a86a;
  letter-spacing: 0.05em;
  text-align: left;
}

.stage-subtitle,
.hero-subtitle,
.section-tip,
.ribbon-cell small,
.crest-label,
.attr-copy p,
.mini-card p,
.gear-slot small,
.ability-chip p,
.feat-panel p,
.spell-panel p {
  color: var(--text-soft);
  line-height: 1.65;
}

.stage-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
}

.portrait-wrap {
  position: relative;
  flex: 1 1;
  min-height: 0;
  padding: 0 6px 8px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.portrait {
  position: relative;
  width: 100%;
  height: calc(100vh - 210px);
  max-height: none;
  object-fit: contain;
  object-position: center top;
  border-radius: 22px;
  z-index: 1;
  display: block;
}

.portrait-shadow,
.portrait-glow {
  position: absolute;
  inset: 14px;
  border-radius: 22px;
  pointer-events: none;
}

.portrait-shadow {
  background: linear-gradient(
    180deg,
    rgba(17, 16, 19, 0.02) 0%,
    rgba(17, 16, 19, 0.12) 35%,
    rgba(17, 16, 19, 0.68) 100%
  );
  z-index: 2;
}

.portrait-glow {
  background: radial-gradient(
      circle at 80% 14%,
      rgba(210, 171, 99, 0.12),
      transparent 24%
    ),
    radial-gradient(circle at 22% 78%, rgba(142, 42, 50, 0.15), transparent 28%);
  mix-blend-mode: screen;
  z-index: 3;
}

.crest-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 10px 12px;
}

.crest-card,
.card-surface,
.mini-card,
.gear-slot,
.ability-chip,
.feat-panel,
.spell-panel,
.ribbon-cell,
.medallion {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(40, 33, 35, 0.9),
    rgba(27, 24, 27, 0.94)
  );
  border: 1px solid rgba(210, 171, 99, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.crest-card {
  padding: 12px 14px;
  background: transparent;
  box-shadow: none;
  border-color: rgba(210, 171, 99, 0.1);
}

.crest-label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.crest-card strong {
  font-size: 14px;
}

.right-stage {
  height: calc(100vh - 24px);
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(210, 171, 99, 0.38) rgba(255, 255, 255, 0.04);
}

.right-stage::-webkit-scrollbar {
  width: 10px;
}

.right-stage::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.right-stage::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(210, 171, 99, 0.72),
    rgba(142, 42, 50, 0.72)
  );
  border-radius: 999px;
}

/* 暗金滚动条：用于角色卡主体与所有弹窗内部滚动区域 */
.right-stage,
[role='dialog'],
[role='dialog'] *,
[data-slot='dialog-content'],
[data-slot='dialog-content'] * {
  scrollbar-width: thin;
  scrollbar-color: rgba(210, 171, 99, 0.38) rgba(255, 255, 255, 0.04);
}

.right-stage::-webkit-scrollbar,
[role='dialog']::-webkit-scrollbar,
[role='dialog'] *::-webkit-scrollbar,
[data-slot='dialog-content']::-webkit-scrollbar,
[data-slot='dialog-content'] *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.right-stage::-webkit-scrollbar-track,
[role='dialog']::-webkit-scrollbar-track,
[role='dialog'] *::-webkit-scrollbar-track,
[data-slot='dialog-content']::-webkit-scrollbar-track,
[data-slot='dialog-content'] *::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.right-stage::-webkit-scrollbar-thumb,
[role='dialog']::-webkit-scrollbar-thumb,
[role='dialog'] *::-webkit-scrollbar-thumb,
[data-slot='dialog-content']::-webkit-scrollbar-thumb,
[data-slot='dialog-content'] *::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(210, 171, 99, 0.72),
    rgba(142, 42, 50, 0.72)
  );
  border-radius: 999px;
}

.right-stage::-webkit-scrollbar-button,
[role='dialog']::-webkit-scrollbar-button,
[role='dialog'] *::-webkit-scrollbar-button,
[data-slot='dialog-content']::-webkit-scrollbar-button,
[data-slot='dialog-content'] *::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.hero-panel,
.section-block {
  position: relative;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.hero-panel::after,
.ornate-separator::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(210, 171, 99, 0.62),
    rgba(209, 213, 220, 0.16),
    transparent
  );
}

.hero-title {
  font-size: 34px;
}

.hero-subtitle {
  max-width: 760px;
  margin: 10px 0 0;
  font-size: 14px;
}

.status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.status-tags span {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(
    180deg,
    rgba(142, 42, 50, 0.32),
    rgba(44, 28, 30, 0.84)
  );
  border: 1px solid rgba(210, 171, 99, 0.18);
}

.combat-rack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.medallion {
  padding: 18px 16px 16px;
  text-align: center;
  clip-path: polygon(
    12% 0,
    88% 0,
    100% 14%,
    100% 86%,
    88% 100%,
    12% 100%,
    0 86%,
    0 14%
  );
  overflow: hidden;
}

.medallion::before {
  content: '';
  position: absolute;
  inset: 1px;
  clip-path: inherit;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.medallion-gold {
  background: linear-gradient(
    180deg,
    rgba(79, 58, 23, 0.9),
    rgba(35, 28, 22, 0.94)
  );
}

.medallion-red {
  background: linear-gradient(
    180deg,
    rgba(88, 30, 35, 0.92),
    rgba(33, 20, 24, 0.95)
  );
}

.medallion-silver {
  background: linear-gradient(
    180deg,
    rgba(56, 59, 66, 0.92),
    rgba(30, 31, 35, 0.96)
  );
}

.medallion-name {
  display: block;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}

.medallion strong {
  display: block;
  margin: 10px 0 8px;
  font-family: 'Cinzel', serif;
  font-size: 44px;
  color: #fff0d4;
  text-shadow: 0 0 18px rgba(210, 171, 99, 0.35);
  animation: pulseGlow 3.8s ease-in-out infinite;
}

.medallion small {
  display: block;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-soft);
}

.hp-medallion {
  padding: 18px 16px 16px;
}

.hp-medallion-clickable {
  cursor: pointer;
}

.hp-medallion-clickable:focus-visible {
  outline: 2px solid rgba(232, 201, 122, 0.72);
  outline-offset: 4px;
}

.hp-value-trigger {
  display: block;
  width: 100%;
}

.hp-value-trigger strong {
  transition: transform 160ms ease, text-shadow 160ms ease;
}

.hp-value-trigger:hover strong {
  transform: translateY(-1px) scale(1.03);
  text-shadow: 0 0 26px rgba(232, 201, 122, 0.5);
}

.hp-dialog {
  width: min(520px, calc(100vw - 24px));
  max-width: 520px;
}

.hp-dialog-body {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
}

.hp-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hp-summary-grid div {
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(210, 171, 99, 0.14);
}

.hp-summary-grid span,
.hp-dialog-input-row span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}

.hp-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-family: 'Cinzel', serif;
  font-size: 34px;
  color: #fff0d4;
}

.hp-dialog-input-row {
  display: grid;
  gap: 8px;
}

.hp-dialog-input-row input {
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(210, 171, 99, 0.18);
  background: rgba(10, 8, 9, 0.48);
  color: #f3eadc;
  color-scheme: light;
}

.hp-dialog-input-row input[type='number']::-webkit-inner-spin-button,
.hp-dialog-input-row input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: auto;
  background: rgba(30, 22, 12, 0.85);
  border-left: 1px solid rgba(210, 171, 99, 0.18);
  border-radius: 0 14px 14px 0;
  filter: invert(1) brightness(0.45);
  opacity: 1;
  cursor: pointer;
}

.hp-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hp-dialog-actions .hp-action-button {
  height: 42px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hp-dialog-actions .hp-damage-button {
  border-color: rgba(214, 89, 75, 0.42);
  background: linear-gradient(
    135deg,
    rgba(107, 34, 28, 0.86),
    rgba(46, 18, 18, 0.96)
  );
  color: #ffd8ce;
  box-shadow: 0 12px 24px rgba(82, 20, 17, 0.22);
}

.hp-dialog-actions .hp-damage-button:hover {
  border-color: rgba(248, 126, 101, 0.74);
  background: linear-gradient(
    135deg,
    rgba(136, 43, 34, 0.94),
    rgba(65, 23, 22, 0.98)
  );
  color: #fff0e8;
}

.hp-dialog-actions .hp-heal-button {
  border: 1px solid rgba(143, 196, 128, 0.36);
  background: linear-gradient(
    135deg,
    rgba(44, 96, 61, 0.94),
    rgba(22, 51, 37, 0.98)
  );
  color: #ddffd8;
  box-shadow: 0 12px 24px rgba(17, 64, 38, 0.22);
}

.hp-dialog-actions .hp-heal-button:hover {
  border-color: rgba(174, 224, 148, 0.72);
  background: linear-gradient(
    135deg,
    rgba(56, 122, 74, 0.98),
    rgba(27, 69, 45, 1)
  );
  color: #f3ffed;
}

.section-block {
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.section-title-bar,
.subhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title-bar h3,
.subhead h3 {
  margin: 0;
  font-size: 24px;
}

.section-tip {
  margin: 0;
  font-size: 13px;
  max-width: 480px;
  text-align: right;
}

.stats-layout {
  display: flex;
  align-items: stretch;
  gap: 16px;
  min-height: 430px;
}

.card-surface {
  padding: 16px;
}

.radar-card {
  flex: 4 1;
  min-width: 0;
  min-height: 380px;
  display: grid;
  place-items: center;
  padding: 28px 18px 30px;
  overflow: visible;
  background: transparent;
}

.radar-svg {
  width: min(100%, 360px);

  height: auto;

  overflow: visible;
}

.attr-badges {
  flex: 1 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.attr-badge {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.92),
    rgba(28, 26, 30, 0.96)
  );
  border: 1px solid rgba(210, 171, 99, 0.14);
}

.accent-badge {
  background: linear-gradient(
    180deg,
    rgba(79, 28, 35, 0.9),
    rgba(31, 21, 24, 0.96)
  );
}

.attr-orb {
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 30% 28%,
    rgba(255, 255, 255, 0.18),
    rgba(210, 171, 99, 0.08) 40%,
    rgba(60, 35, 12, 0.92) 70%,
    rgba(70, 41, 15, 0.95)
  );
  border: 1px solid rgba(210, 171, 99, 0.34);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28), 0 0 20px
    rgba(210, 171, 99, 0.12);
  text-align: center;
}

.accent-badge .attr-orb {
  animation: pulseGlow 3.8s ease-in-out infinite;
}

.attr-orb span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.attr-orb strong {
  display: block;
  margin-top: 2px;
  font-family: 'Cinzel', serif;
  font-size: 28px;
}

.mini-card h4,
.gear-slot h4,
.ability-chip h4,
.feat-panel h4,
.spell-panel h4,
.ribbon-cell strong {
  margin: 0 0 6px;
  font-size: 16px;
}

.mini-card p,
.gear-slot p,
.gear-slot small,
.ability-chip p,
.feat-panel p,
.spell-panel p,
.ribbon-cell small {
  margin: 0;
  font-size: 13px;
}

.feat-panel p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.attr-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.attr-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.attr-mod-tag,
.attr-save-tag {
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.attr-mod-tag strong,
.attr-save-tag strong {
  font-size: 13px;
  font-family: 'Cinzel', serif;
  color: var(--text-hi);
  font-weight: 600;
}

.attr-save-tag {
  color: rgba(210, 171, 99, 0.65);
  padding-left: 10px;
  border-left: 1px solid rgba(210, 171, 99, 0.2);
}

.attr-save-tag strong {
  color: rgba(210, 171, 99, 0.9);
}

.attr-desc {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.5;
  margin: 0;
}

.mini-card code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(210, 171, 99, 0.16);
  color: #fff0d4;
}

.split-zone {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.single-panel-zone {
  grid-template-columns: minmax(0, 1fr);
}

.panel-slab {
  padding: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.mini-grid,
.gear-grid,
.ability-grid,
.feat-panels,
.spell-layout,
.footer-ribbon {
  display: grid;
  gap: 12px;
}

.mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-card {
  padding: 14px;
}

.aura-banner {
  margin-top: 12px;
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: 18px;
  background: linear-gradient(
    90deg,
    rgba(82, 29, 34, 0.88),
    rgba(35, 24, 27, 0.92)
  );
  border: 1px solid rgba(210, 171, 99, 0.22);
}

.aura-mark {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: 'Cinzel', serif;
  background: radial-gradient(
    circle,
    rgba(210, 171, 99, 0.42),
    rgba(92, 52, 16, 0.95)
  );
  border: 1px solid rgba(210, 171, 99, 0.36);
}

.aura-banner strong {
  display: block;
  margin-bottom: 6px;
}

.aura-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.gear-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gear-slot {
  min-height: 90px;
  padding: 10px 14px;
  overflow: hidden;
}

/* 稀有度标签 — 右上角 */
.gear-rarity {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  pointer-events: none;
}
.gear-rarity-普通 {
  background: rgba(160, 160, 160, 0.18);
  color: #aaa;
  border: 1px solid rgba(160, 160, 160, 0.3);
}
.gear-rarity-非凡 {
  background: rgba(30, 180, 90, 0.15);
  color: #5dba7a;
  border: 1px solid rgba(30, 180, 90, 0.35);
}
.gear-rarity-稀有 {
  background: rgba(60, 120, 220, 0.18);
  color: #6fa8f5;
  border: 1px solid rgba(60, 120, 220, 0.4);
}
.gear-rarity-极稀有 {
  background: rgba(160, 70, 220, 0.18);
  color: #c07cf5;
  border: 1px solid rgba(160, 70, 220, 0.4);
}
.gear-rarity-传奇 {
  background: rgba(220, 140, 30, 0.2);
  color: #e8ac3a;
  border: 1px solid rgba(220, 140, 30, 0.45);
}

.gear-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(210, 171, 99, 0.08), transparent 42%);
  pointer-events: none;
}

.slot-type,
.feat-badge,
.ribbon-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(210, 171, 99, 0.18);
  font-size: 12px;
  color: var(--gold);
}

.main-weapon {
  background: linear-gradient(
    180deg,
    rgba(55, 36, 30, 0.92),
    rgba(30, 24, 27, 0.96)
  );
}

.ability-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ability-chip {
  display: flex;
  gap: 14px;
  padding: 14px;
  align-items: flex-start;
}

.compact-ability-chip {
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  min-height: 64px;
}

.compact-ability-chip h4 {
  margin: 0;
}

.compact-ability-chip .chip-icon,
.compact-ability-chip .ability-chip-arrow {
  display: none;
}

.chip-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 18px;
  color: #fff1d2;
  background: radial-gradient(
    circle at top,
    rgba(210, 171, 99, 0.38),
    rgba(95, 56, 19, 0.95)
  );
  border: 1px solid rgba(210, 171, 99, 0.3);
}

.feat-panels {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.feat-panel {
  padding: 16px;
}

.feat-badge {
  margin-bottom: 10px;
}

.feat-badge.accent {
  color: #ffd9d9;
  background: rgba(142, 42, 50, 0.24);
  border-color: rgba(142, 42, 50, 0.32);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.skill-card {
  position: relative;
  border-radius: 12px;
  padding: 8px 10px;
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.92),
    rgba(28, 26, 30, 0.96)
  );
  border: 1px solid rgba(210, 171, 99, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.skill-card.expertise {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--gold) 24%, rgba(44, 37, 38, 0.92)),
    rgba(28, 26, 30, 0.96)
  );
  border-color: color-mix(in srgb, var(--gold) 58%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--gold) 18%, transparent);
}

.skill-card.proficient {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--red) 34%, rgba(44, 37, 38, 0.92)),
    rgba(31, 21, 24, 0.96)
  );
  border-color: color-mix(in srgb, var(--gold) 34%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--gold) 10%, transparent);
}

.skill-card.untrained {
  opacity: 0.72;
}

.skill-copy strong {
  display: block;
  font-size: 12px;
  color: #f5eee2;
}

.skill-copy span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-dim);
}

.skill-value {
  flex-shrink: 0;
  min-width: 38px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: #fff0d4;
}

.spell-layout {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.spell-dual-layout {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.spell-quad-layout {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.spell-column {
  min-width: 0;
}

.compact-panel-head {
  margin-bottom: 8px;
}

.compact-panel-head h4 {
  font-size: 15px;
}

.compact-spell-grid {
  gap: 8px;
  margin-top: 10px;
}

.compact-spell-card {
  padding: 12px;
}

.compact-spell-card p {
  font-size: 12px;
  line-height: 1.5;
}

.compact-free-list {
  gap: 8px;
  margin-top: 10px;
}

.compact-free-panel {
  padding: 12px;
}

.compact-free-panel strong {
  font-size: 24px;
}

.compact-resource-board {
  gap: 10px;
  margin-top: 10px;
}

.compact-resource-actions {
  margin-top: 12px;
}

.level-resource-panel,
.level-spell-panel,
.spell-summary-panel,
.unified-resource-panel,
.spell-list-panel {
  min-height: 100%;
}

.level-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.level-panel-head h4 {
  margin: 0;
}

.level-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(210, 171, 99, 0.18);
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
}

.spell-count-badge {
  color: #f4ddbe;
}

.level-spell-grid {
  margin-top: 8px;
}

.resource-section {
  display: grid;
  gap: 10px;
}

.free-resource-section {
  margin-top: 14px;
}

.resource-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-section-head span {
  font-size: 13px;
  color: #fff0d4;
}

.resource-section-head small {
  color: var(--text-dim);
}

.resource-track-board {
  margin-top: 0;
}

.compact-resource-track {
  padding: 12px 14px;
}

.resource-free-use-list {
  margin-top: 14px;
}

.always-free-panel {
  background: linear-gradient(
    90deg,
    rgba(57, 44, 28, 0.84),
    rgba(31, 24, 18, 0.92)
  );
}

.spell-level-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.spell-level-group {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(42, 34, 37, 0.88),
    rgba(24, 22, 27, 0.94)
  );
  border: 1px solid rgba(210, 171, 99, 0.12);
}

.spell-level-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.spell-level-group-head h5,
.spell-level-group-head span {
  margin: 0;
}

.spell-level-group-head span {
  color: var(--text-dim);
  font-size: 12px;
}

.free-cast-note {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(46, 37, 40, 0.92),
    rgba(24, 22, 28, 0.96)
  );
  border: 1px solid rgba(210, 171, 99, 0.12);
}

.free-cast-note strong {
  display: block;
  margin-bottom: 6px;
  color: #fff0d4;
}

.free-cast-note p {
  margin: 0;
}

.free-use-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.free-use-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(210, 171, 99, 0.12);
}

.free-use-summary-item span {
  font-size: 13px;
  color: var(--text-soft);
}

.free-use-summary-item strong {
  font-family: 'Cinzel', serif;
  color: #fff0d4;
}

.compact-usage-log {
  flex: 1 1;
}

.spell-panel {
  padding: 16px;
}

.spell-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.spell-tags span {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(209, 213, 220, 0.12);
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.slot-label {
  font-size: 14px;
  font-weight: 700;
}

.slot-orbs {
  display: flex;
  gap: 10px;
}

.orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(210, 171, 99, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.orb.active {
  background: radial-gradient(
    circle at 35% 35%,
    #fff1ca,
    #d2ab63 48%,
    #7f5520 100%
  );
  box-shadow: 0 0 12px rgba(210, 171, 99, 0.45), 0 0 20px
    rgba(142, 42, 50, 0.25);
  animation: pulseGlow 3.8s ease-in-out infinite;
}

.footer-ribbon {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ribbon-cell {
  padding: 10px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ribbon-inline-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.ribbon-title {
  display: inline;
  margin: 0;
  color: var(--gold);
}

.ribbon-cell strong,
.ribbon-cell small {
  display: inline;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.ribbon-cell strong::before,
.ribbon-cell small::before {
  content: '·';
  margin-right: 6px;
  color: rgba(210, 171, 99, 0.55);
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(210, 171, 99, 0.35);
  }
  50% {
    box-shadow: 0 0 20px rgba(210, 171, 99, 0.55), 0 0 28px
      rgba(142, 42, 50, 0.22);
  }
}

@media (max-width: 1540px) {
  .spell-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* spell-dual-layout / spell-quad-layout 保持 4 列，不在此处覆盖 */
  /* combat-rack 和 spell-quad-layout 保持用户指定列数，不在此处覆盖 */

  .skill-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats-layout,
  .split-zone {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1220px) {
  .ui-frame {
    grid-template-columns: 1fr;
  }

  .left-stage,
  .right-stage {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
  }

  .portrait-wrap {
    min-height: 560px;
  }

  .portrait {
    max-height: 720px;
  }

  .status-tags {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .ui-frame {
    width: calc(100vw - 12px);
    padding: 6px;
    gap: 10px;
  }

  .hero-panel,
  .section-title-bar,
  .subhead,
  .attr-badges,
  .mini-grid,
  .gear-grid,
  .ability-grid,
  .feat-panels,
  .spell-layout,
  .crest-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  /* 以下保持固定列数，不在 900px 断点折叠 */
  .combat-rack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .spell-dual-layout,
  .spell-quad-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .skill-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-panel,
  .section-title-bar,
  .subhead {
    align-items: flex-start;
  }

  .section-tip {
    text-align: left;
  }
}

.interactive-layout {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.interactive-panel {
  min-height: 100%;
}

.interactive-spell-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.interactive-spell {
  width: 100%;
  padding: 14px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(210, 171, 99, 0.14);
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.92),
    rgba(24, 24, 29, 0.96)
  );
  color: var(--text-main);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms
    ease, background 160ms ease;
}

.interactive-spell:hover {
  transform: translateY(-2px);
  border-color: rgba(210, 171, 99, 0.34);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
  background: linear-gradient(
    180deg,
    rgba(58, 43, 39, 0.94),
    rgba(30, 24, 29, 0.98)
  );
}

.interactive-spell:focus-visible {
  outline: 2px solid rgba(210, 171, 99, 0.55);
  outline-offset: 2px;
}

.spell-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.spell-headline strong {
  font-size: 15px;
}

.spell-level-pill {
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: #f8e9c9;
  background: rgba(142, 42, 50, 0.25);
  border: 1px solid rgba(210, 171, 99, 0.16);
}

.interactive-spell p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
}

.spell-source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.spell-source-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(209, 213, 220, 0.12);
  color: var(--text-soft);
}

.compact-spell-card .spell-source-tags {
  flex-wrap: nowrap;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.compact-spell-card .spell-source-tags span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spell-source-tags .free-tag {
  color: #ffe2b3;
  border-color: rgba(210, 171, 99, 0.24);
  background: rgba(210, 171, 99, 0.12);
}

.resource-panel {
  display: flex;
  flex-direction: column;
}

.slot-track-board {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.slot-track {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(47, 40, 41, 0.92),
    rgba(24, 23, 27, 0.95)
  );
  border: 1px solid rgba(210, 171, 99, 0.12);
}

.slot-track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.slot-track-head strong {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  color: #fff1d2;
}

.big-orbs {
  gap: 12px;
}

.big-orbs .orb {
  width: 20px;
  height: 20px;
}

.orb.used {
  opacity: 0.32;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.free-use-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.free-use-panel {
  margin-top: 0;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    rgba(61, 26, 31, 0.84),
    rgba(32, 22, 25, 0.92)
  );
  border: 1px solid rgba(210, 171, 99, 0.18);
}

.free-use-title {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
}

.free-use-panel strong {
  display: block;
  margin-top: 6px;
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: #fff0d4;
}

.free-use-panel small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.feedback-banner {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(209, 213, 220, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.feedback-banner strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.feedback-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
}

.feedback-banner.success {
  background: linear-gradient(
    90deg,
    rgba(44, 76, 42, 0.42),
    rgba(24, 32, 22, 0.9)
  );
  border-color: rgba(130, 185, 115, 0.22);
}

.feedback-banner.error {
  background: linear-gradient(
    90deg,
    rgba(101, 31, 38, 0.54),
    rgba(35, 20, 24, 0.92)
  );
  border-color: rgba(189, 92, 92, 0.25);
}

.feedback-banner.info {
  background: linear-gradient(
    90deg,
    rgba(62, 53, 31, 0.54),
    rgba(27, 24, 19, 0.92)
  );
  border-color: rgba(210, 171, 99, 0.22);
}

.cast-log-panel {
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.92),
    rgba(28, 26, 30, 0.96)
  );
  border-color: rgba(210, 171, 99, 0.14);
}

.resource-actions {
  margin-top: 14px;
}

.rest-button {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  font-weight: 800;
  color: #fff0d4;
  background: linear-gradient(
    180deg,
    rgba(145, 48, 54, 0.95),
    rgba(90, 29, 34, 0.98)
  );
  border: 1px solid rgba(210, 171, 99, 0.22);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

.rest-button:hover {
  background: linear-gradient(
    180deg,
    rgba(168, 56, 64, 0.98),
    rgba(101, 35, 39, 1)
  );
}

.usage-log {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(209, 213, 220, 0.08);
}

.usage-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.usage-log-head h5 {
  margin: 0;
  font-size: 14px;
}

.usage-log-head span {
  font-size: 12px;
  color: var(--text-dim);
}

.usage-log ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.usage-log li,
.usage-empty {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
}

.usage-empty {
  margin: 0;
}

.dice-fab-wrap {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
}

.dice-fab-wrap.dragging {
  z-index: 46;
}

.dice-fab {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(210, 171, 99, 0.3);
  background: linear-gradient(
    180deg,
    rgba(88, 30, 35, 0.96),
    rgba(42, 28, 24, 0.98)
  );
  color: #fff0d4;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34), 0 0 24px rgba(210, 171, 99, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms
    ease;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
          user-select: none;
}

.dice-fab:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(232, 201, 122, 0.58);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42), 0 0 30px rgba(210, 171, 99, 0.2);
}

.dice-fab-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 240, 212, 0.18),
    rgba(210, 171, 99, 0.24) 38%,
    rgba(74, 44, 18, 0.95)
  );
  border: 1px solid rgba(210, 171, 99, 0.35);
  font-size: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dice-fab-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.dice-fab-copy strong {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  line-height: 1;
}

.dice-fab-copy small {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.dice-dialog {
  width: min(860px, calc(100vw - 24px));
  max-width: 860px;
  max-height: 90vh;
  border-radius: 24px;
  border: 1px solid rgba(210, 171, 99, 0.24);
  box-shadow: 0 32px 68px rgba(0, 0, 0, 0.52);
}

.dice-dialog-body {
  display: grid;
  gap: 16px;
  padding-top: 6px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.dice-quick-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dice-quick-block {
  padding: 12px 16px;
}

.dice-quick-block p,
.dice-expression-block p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.dice-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dice-quick-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(210, 171, 99, 0.18);
  background: linear-gradient(
    180deg,
    rgba(56, 32, 28, 0.94),
    rgba(25, 21, 25, 0.98)
  );
  color: #f6e7c7;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms
    ease;
}

.dice-quick-button:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 201, 122, 0.46);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.dice-expression-block {
  padding: 12px 16px;
}

.dice-expression-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.dice-expression-input {
  flex: 1 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(210, 171, 99, 0.18);
  background: rgba(10, 8, 9, 0.48);
  color: #f3eadc;
}

.dice-expression-input::placeholder {
  color: var(--text-dim);
}

.dice-expression-input:focus {
  outline: none;
  border-color: rgba(232, 201, 122, 0.52);
  box-shadow: 0 0 0 3px rgba(210, 171, 99, 0.12);
}

.dice-expression-error {
  margin: 10px 0 0;
  color: #ffb7c1;
  font-size: 12px;
}

.dice-count-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(210, 171, 99, 0.12);
}

.dice-count-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.dice-count-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dice-count-button {
  min-width: 56px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(210, 171, 99, 0.16);
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.92),
    rgba(28, 26, 30, 0.96)
  );
  color: var(--text-soft);
  font-size: 12px;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
}

.dice-count-button:hover,
.dice-count-button.active {
  color: #fff0d4;
  transform: translateY(-1px);
  border-color: rgba(232, 201, 122, 0.48);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), 0 0 16px rgba(210, 171, 99, 0.12);
}

.dice-grid-wrap {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.dice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}

.dice-option {
  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 4px;

  padding: 8px 6px;

  border-radius: 18px;

  border: 1px solid rgba(210, 171, 99, 0.16);

  background: linear-gradient(
    180deg,
    rgba(46, 39, 40, 0.92),
    rgba(24, 22, 27, 0.96)
  );

  color: var(--text-main);

  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms
    ease, background 160ms ease;
}

.dice-option:hover,
.dice-option.active {
  transform: translateY(-2px);

  border-color: rgba(232, 201, 122, 0.46);

  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28), 0 0 20px rgba(210, 171, 99, 0.14);

  background: linear-gradient(
    180deg,
    rgba(88, 32, 38, 0.96),
    rgba(38, 25, 28, 0.98)
  );
}

.dice-option-icon {
  width: 36px;

  height: 36px;

  display: grid;

  place-items: center;

  border-radius: 12px;

  font-size: 18px;

  color: #fff1d2;

  background: radial-gradient(
    circle at 30% 30%,
    rgba(210, 171, 99, 0.32),
    rgba(95, 56, 19, 0.92)
  );

  border: 1px solid rgba(210, 171, 99, 0.24);
}

.dice-option strong {
  font-family: 'Cinzel', serif;

  font-size: 16px;

  color: #fff0d4;
}

.dice-option small {
  font-size: 10px;

  color: var(--text-dim);
}

.dice-result-panel {
  min-height: 190px;
  padding: 14px 16px;
  border-radius: 18px;
  text-align: center;
  background: radial-gradient(
      circle at top,
      rgba(210, 171, 99, 0.16),
      transparent 42%
    ), linear-gradient(180deg, rgba(50, 31, 23, 0.88), rgba(25, 21, 24, 0.96));
  border: 1px solid rgba(210, 171, 99, 0.18);
}

.dice-result-animating {
  min-height: 210px;
  overflow: visible;
}

.dice-animation-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 8px;
}

.dice-animation-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(72, 39, 28, 0.94),
    rgba(28, 20, 22, 0.98)
  );
  border: 1px solid rgba(210, 171, 99, 0.18);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.dice-animation-chip.rolling {
  animation: dice-roll-wobble 620ms ease-in-out infinite;
}

.dice-animation-chip.rolling .dice-animation-icon {
  display: inline-block;
  animation: dice-icon-spin 460ms linear infinite;
  transform-origin: center;
}

.dice-animation-chip.rolling strong {
  animation: rolling-face-blink 140ms steps(2, end) infinite;
}

.dice-animation-chip.settled {
  animation: dice-settle-pop 220ms ease-out;
  border-color: rgba(232, 201, 122, 0.4);
}

.dice-animation-icon {
  font-size: 18px;
  opacity: 0.9;
}

.dice-animation-chip strong {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: #fff0d4;
}

.rolling-number {
  animation: rolling-total-flicker 180ms linear infinite;
}

.dice-result-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.dice-result-formula {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.dice-result-equation {
  margin: 8px 0 6px;
  font-family: 'Cinzel', serif;
  font-size: 30px;
  line-height: 1.1;
  color: #fff3d8;
  text-shadow: 0 0 22px rgba(210, 171, 99, 0.24);
}

.dice-result-value {
  margin: 6px 0 4px;
  font-family: 'Cinzel', serif;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1;
  color: #fff3d8;
  text-shadow: 0 0 24px rgba(210, 171, 99, 0.28);
}

.dice-result-placeholder {
  opacity: 0.58;
}

.dice-roll-breakdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 10px;
}

.dice-roll-breakdown span {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 42px;
  min-height: 42px;
  padding: 5px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(210, 171, 99, 0.16);
  color: #fff0d4;
}

.dice-roll-breakdown span strong {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  line-height: 1;
}

.dice-roll-breakdown span small {
  font-size: 14px;
  line-height: 1;
  opacity: 0.8;
}

.dice-roll-breakdown span.selected {
  background: linear-gradient(
    180deg,
    rgba(110, 53, 24, 0.96),
    rgba(64, 29, 20, 0.98)
  );
  border-color: rgba(232, 201, 122, 0.44);
  color: #fff0cf;
  box-shadow: 0 0 18px rgba(210, 171, 99, 0.18);
}

.dice-result-text {
  font-size: 15px;
  color: var(--text-soft);
}

.dice-result-detail {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.dice-result-banner {
  margin: 12px auto 0;
  width: -moz-fit-content;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dice-result-banner.critical {
  color: #fff2cf;
  background: linear-gradient(
    135deg,
    rgba(210, 171, 99, 0.34),
    rgba(142, 42, 50, 0.34)
  );
  border: 1px solid rgba(232, 201, 122, 0.44);
}

.dice-result-banner.fumble {
  color: #ffd4d7;
  background: linear-gradient(
    135deg,
    rgba(142, 42, 50, 0.42),
    rgba(55, 16, 22, 0.5)
  );
  border: 1px solid rgba(176, 62, 74, 0.46);
}

.dice-result-critical {
  background: radial-gradient(
      circle at top,
      rgba(210, 171, 99, 0.28),
      transparent 42%
    ), linear-gradient(180deg, rgba(92, 48, 20, 0.9), rgba(44, 18, 20, 0.98));
  border-color: rgba(232, 201, 122, 0.38);
  box-shadow: 0 0 28px rgba(210, 171, 99, 0.18);
}

.dice-result-critical .dice-result-value {
  color: #ffe7a4;
  text-shadow: 0 0 26px rgba(210, 171, 99, 0.54), 0 0 12px
    rgba(176, 44, 46, 0.38);
}

.dice-result-fumble {
  background: radial-gradient(
      circle at top,
      rgba(142, 42, 50, 0.24),
      transparent 42%
    ), linear-gradient(180deg, rgba(56, 20, 24, 0.92), rgba(24, 14, 18, 0.98));
  border-color: rgba(176, 62, 74, 0.34);
  box-shadow: 0 0 28px rgba(142, 42, 50, 0.18);
}

.dice-result-fumble .dice-result-value {
  color: #ffbcc5;
  text-shadow: 0 0 24px rgba(142, 42, 50, 0.5);
}

.dice-history-block {
  padding: 16px;
}

.dice-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dice-history-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(210, 171, 99, 0.14);
  color: #f0dfa0;
  font-size: 12px;
}

.dice-history-item.critical {
  border-color: rgba(232, 201, 122, 0.38);
  color: #ffe6a2;
}

.dice-history-item.fumble {
  border-color: rgba(176, 62, 74, 0.4);
  color: #ffc0c9;
}

@keyframes dice-roll-wobble {
  0% {
    transform: rotate(-16deg) translateY(0) scale(0.96);
  }
  25% {
    transform: rotate(14deg) translateY(-6px) scale(1.02);
  }
  50% {
    transform: rotate(-10deg) translateY(3px) scale(0.98);
  }
  75% {
    transform: rotate(10deg) translateY(-3px) scale(1.01);
  }
  100% {
    transform: rotate(-16deg) translateY(0) scale(0.96);
  }
}

@keyframes dice-settle-pop {
  0% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes dice-icon-spin {
  0% {
    transform: rotate(0deg) scale(0.96);
  }
  50% {
    transform: rotate(180deg) scale(1.08);
  }
  100% {
    transform: rotate(360deg) scale(0.96);
  }
}

@keyframes rolling-face-blink {
  0% {
    opacity: 0.36;
    transform: translateY(-3px);
  }
  50% {
    opacity: 1;
    transform: translateY(2px);
  }
  100% {
    opacity: 0.36;
    transform: translateY(-3px);
  }
}

@keyframes rolling-total-flicker {
  0% {
    opacity: 0.45;
    transform: translateY(-2px);
  }
  50% {
    opacity: 0.95;
    transform: translateY(2px);
  }
  100% {
    opacity: 0.45;
    transform: translateY(-2px);
  }
}

.spell-dialog {
  width: min(720px, calc(100vw - 24px));
  max-width: 720px;
  max-height: 90vh;
  border-radius: 24px;
  border: 1px solid rgba(210, 171, 99, 0.24);
  background: linear-gradient(
    180deg,
    rgba(33, 29, 31, 0.98),
    rgba(18, 17, 21, 0.98)
  );
  color: var(--text-main);
  box-shadow: 0 32px 68px rgba(0, 0, 0, 0.52);
}

.spell-dialog button.absolute {
  color: var(--text-soft);
}

.spell-dialog-header {
  gap: 10px;
}

.dialog-kicker-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dialog-kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.dialog-tags {
  margin-top: 0;
}

.spell-dialog-title {
  font-family: 'Cinzel', serif;
  font-size: 32px;
  color: #fff0d4;
}

.spell-dialog-description,
.spell-detail-block p,
.resource-inline-note li {
  color: var(--text-soft);
}

.spell-dialog-body {
  display: grid;
  gap: 14px;
  padding-top: 6px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.spell-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.spell-meta-chip,
.spell-detail-block {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(45, 38, 39, 0.9),
    rgba(25, 23, 28, 0.96)
  );
  border: 1px solid rgba(210, 171, 99, 0.14);
}

.spell-detail-block {
  background: transparent;
  box-shadow: none;
  border-color: rgba(210, 171, 99, 0.1);
}

.spell-meta-chip span {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
}

.spell-meta-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  color: #fff0d4;
}

.spell-detail-block h5 {
  margin: 0 0 8px;
  font-size: 15px;
}

.spell-detail-block p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.resource-inline-note ul {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.spell-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.spell-secondary-btn {
  border-radius: 14px;
  border-color: rgba(210, 171, 99, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.spell-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.spell-cast-btn {
  border-radius: 14px;
  font-weight: 800;
  color: #fff0d4;
  background: linear-gradient(
    180deg,
    rgba(145, 48, 54, 0.95),
    rgba(90, 29, 34, 0.98)
  );
  border: 1px solid rgba(210, 171, 99, 0.22);
}

.spell-cast-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(168, 56, 64, 0.98),
    rgba(101, 35, 39, 1)
  );
}

@media (max-width: 1540px) {
  .interactive-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* spell-dual-layout 已在上方全局样式设为 4 列，此处不再覆盖 */
}

@media (max-width: 900px) {
  .spell-meta-row {
    grid-template-columns: 1fr;
  }

  .interactive-layout,
  .spell-dual-layout {
    grid-template-columns: 1fr;
  }

  .dialog-kicker-row,
  .spell-dialog-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .spell-dialog-footer button {
    width: 100%;
  }

  .dice-fab-wrap {
    right: 14px;
    bottom: auto;
    top: calc(var(--safe-area-top, 0px) + 14px);
  }

  .dice-fab-wrap.dragging .dice-fab {
    cursor: grabbing;
  }

  .dice-fab {
    padding: 12px 14px;
    gap: 10px;
    cursor: grab;
  }

  .dice-fab-copy small {
    letter-spacing: 0.04em;
  }

  .dice-count-selector {
    flex-direction: column;
    align-items: flex-start;
  }

  .dice-quick-layout,
  .dice-expression-row {
    grid-template-columns: 1fr;
  }

  .dice-quick-layout {
    grid-template-columns: 1fr;
  }

  .dice-expression-row {
    display: grid;
  }

  .dice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === 坐骑 & 魔宠板块 === */
.companions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.companion-card {
  padding: 20px 22px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.companion-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.companion-head h4 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: var(--gold);
}

.companion-origin {
  font-size: 12px;
  color: var(--text-soft);
  margin-left: auto;
}

.companion-type-badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(210, 171, 99, 0.18);
  border: 1px solid rgba(210, 171, 99, 0.32);
  color: var(--gold);
  letter-spacing: 0.06em;
}

.raven-badge {
  background: rgba(120, 90, 160, 0.22);
  border-color: rgba(160, 120, 210, 0.38);
  color: #c8a8f0;
}

.companion-lore {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-soft);
}

.companion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.companion-tags span {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(210, 171, 99, 0.15);
  color: var(--text-muted, #888);
}

.steed-card {
  border-color: rgba(210, 171, 99, 0.22);
}

.raven-card {
  border-color: rgba(160, 120, 210, 0.22);
}

@media (max-width: 900px) {
  .companions-grid {
    grid-template-columns: 1fr;
  }
}

/* === 长休修改法术面板 === */
.spell-prep-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.9),
    rgba(28, 26, 30, 0.95)
  );
  border: 1px solid rgba(210, 171, 99, 0.22);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 10px;
}
.spell-prep-trigger:hover {
  border-color: rgba(210, 171, 99, 0.5);
  background: linear-gradient(
    180deg,
    rgba(60, 45, 30, 0.95),
    rgba(35, 28, 22, 0.98)
  );
}
.spell-prep-icon {
  font-size: 18px;
  color: var(--gold);
  flex-shrink: 0;
}
.spell-prep-trigger strong {
  display: block;
  font-size: 14px;
  color: #f5eee2;
}
.spell-prep-trigger p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}
.spell-prep-arrow {
  margin-left: auto;
  font-size: 22px;
  color: var(--gold);
  opacity: 0.6;
}

.spell-prep-dialog {
  width: min(760px, calc(100vw - 24px));
  max-width: 680px;
  max-height: 90vh;
  overflow: hidden;
}
.spell-prep-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 0 8px;
  max-height: calc(90vh - 180px);
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}
.spell-prep-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spell-prep-section-title {
  font-size: 13px;
  color: #e8c97a;
  margin: 0;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.spell-prep-fixed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.spell-prep-fixed-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(210, 171, 99, 0.18);
  border: 1px solid rgba(210, 171, 99, 0.4);
  color: #f0dfa0;
}
.fey-tag {
  background: rgba(120, 90, 160, 0.22);
  border-color: rgba(160, 120, 210, 0.45);
  color: #e0c8ff;
}
.spell-prep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.spell-prep-option {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(44, 37, 38, 0.8);
  border: 1px solid rgba(210, 171, 99, 0.12);
  cursor: default;
}
.spell-prep-option strong {
  display: block;
  font-size: 13px;
  color: #f5eee2;
}
.spell-prep-option span {
  font-size: 11px;
  color: var(--text-soft);
}
.spell-prep-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim, #666);
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* === 背景故事 Dialog === */
.crest-card-expandable {
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;
}
.crest-card-expandable:hover {
  border-color: rgba(210, 171, 99, 0.5);
}
.crest-expand-arrow {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 18px;
  color: rgba(210, 171, 99, 0.6);
}

.lore-dialog {
  width: min(760px, calc(100vw - 24px));
  max-width: 700px;
  max-height: 90vh;
  background: linear-gradient(160deg, #1a1218 0%, #12100e 60%, #1c1510 100%);
  border: 1px solid rgba(210, 171, 99, 0.22);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), inset 0 1px 0
    rgba(210, 171, 99, 0.08);
}
.lore-dialog [data-slot='dialog-title'] {
  color: #e8c97a;
  font-size: 20px;
  letter-spacing: 0.05em;
}
.lore-dialog [data-slot='dialog-description'] {
  color: #9a8878;
}
.lore-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 2px 8px 0;
  max-height: calc(90vh - 180px);
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}
.lore-block {
  position: relative;
  padding: 14px 0 16px;
}
.lore-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.lore-heading-icon {
  color: #f0d899;
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(240, 216, 153, 0.18);
  transform: translateY(-1px);
}
.lore-block h5 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #f0d899;
  text-transform: uppercase;
  opacity: 0.95;
  white-space: nowrap;
}
.lore-paragraphs {
  position: relative;
}
.lore-block p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.9;
  color: #d2c1ad;
  text-wrap: pretty;
}
.lore-block p:last-child {
  margin-bottom: 0;
}
/* === 法术准备选择交互 === */
.spell-prep-select-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.spell-prep-selectable {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(44, 37, 38, 0.8);
  border: 1px solid rgba(210, 171, 99, 0.12);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.spell-prep-selectable:hover:not(.disabled) {
  border-color: rgba(210, 171, 99, 0.4);
}
.spell-prep-selectable.selected {
  border-color: rgba(210, 171, 99, 0.7);
  background: rgba(60, 45, 20, 0.9);
}
.spell-prep-selectable.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.spell-prep-selectable strong {
  display: block;
  font-size: 13px;
  color: #f5eee2;
  font-weight: 600;
}
.spell-prep-selectable span {
  font-size: 11px;
  color: #b0a090;
  display: block;
  margin-top: 2px;
}
.prep-check {
  position: absolute;
  top: 6px;
  right: 10px;
  color: var(--gold) !important;
  font-size: 14px !important;
  margin: 0 !important;
}
/* 准备法术卡样式 */
.prepared-spell-card {
  border-style: dashed !important;
  border-color: rgba(210, 171, 99, 0.25) !important;
  opacity: 0.9;
}

.prepared-pill {
  background: rgba(60, 100, 60, 0.5) !important;
  color: #a8d4a0 !important;
  border-color: rgba(100, 160, 100, 0.3) !important;
}

.smite-slot-block {
  margin-top: 4px;
}

.smite-slot-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.smite-slot-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(210, 171, 99, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s
    ease;
}

.smite-slot-option:hover:not(:disabled) {
  border-color: rgba(240, 195, 92, 0.42);
  background: rgba(210, 171, 99, 0.08);
}

.smite-slot-option.selected {
  border-color: rgba(255, 224, 136, 0.6);
  background: linear-gradient(
    180deg,
    rgba(120, 79, 27, 0.28),
    rgba(54, 36, 17, 0.38)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 233, 168, 0.12);
}

.smite-slot-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.smite-slot-option strong {
  font-size: 15px;
}

.smite-slot-option span {
  color: #ffe3a3;
  font-weight: 700;
}

.smite-slot-option small {
  color: var(--text-soft);
}
/* === 职业能力弹窗 === */
.ability-chip-clickable {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ability-chip-clickable:hover {
  border-color: rgba(210, 171, 99, 0.45);
  background: rgba(50, 38, 22, 0.85);
}
.ability-chip-arrow {
  margin-left: auto;
  font-size: 18px;
  color: rgba(210, 171, 99, 0.5);
  flex-shrink: 0;
}
.ability-detail-dialog {
  width: min(680px, calc(100vw - 24px));
  max-width: 620px;
  max-height: 90vh;
  background: linear-gradient(160deg, #1a1218 0%, #12100e 60%, #1c1510 100%);
  border: 1px solid rgba(210, 171, 99, 0.22);
}
.ability-detail-body {
  max-height: calc(90vh - 180px);
  overflow-y: auto;
  min-height: 0;
  padding: 4px 4px 8px 0;
}
.ability-detail-body p {
  font-size: 14px;
  line-height: 1.75;
  color: #c8b8a8;
  margin: 0;
}

/* === 弹窗全局视觉统一 === */

/* Dialog 背景和边框统一 */
[data-slot='dialog-content'][role='dialog'],
[role='dialog'] [data-slot='dialog-content'] {
  background: linear-gradient(160deg, #1c1510 0%, #120f0d 60%, #1a1410 100%);
  border: 1px solid rgba(210, 171, 99, 0.2);
  color: #d4c4b0;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Dialog 标题颜色 */
[data-slot='dialog-title'],
[role='dialog'] [data-slot='dialog-title'] {
  color: #e8c97a;
  letter-spacing: 0.04em;
}

/* Dialog 描述文字颜色 */
[data-slot='dialog-description'],
[role='dialog'] [data-slot='dialog-description'] {
  color: #9a8878;
}

/* Dialog 关闭按钮（右上角 × 按钮） */
[data-slot='dialog-close'],
[role='dialog'] [data-slot='dialog-close'] {
  color: rgba(210, 171, 99, 0.5);
  opacity: 1;
}
[data-slot='dialog-close']:hover,
[role='dialog'] [data-slot='dialog-close']:hover {
  color: rgba(210, 171, 99, 0.9);
  background: rgba(210, 171, 99, 0.08);
}

/* Dialog 底部 outline 按钮（"关闭"文字按钮） */
[role='dialog'] .dialog-footer button[data-variant='outline'],
[data-slot='dialog-footer'] button[data-variant='outline'],
[role='dialog'] [data-slot='dialog-footer'] button[data-variant='outline'] {
  border-color: rgba(210, 171, 99, 0.3);
  color: #c8a86a;
  background: rgba(210, 171, 99, 0.06);
}
[role='dialog'] .dialog-footer button[data-variant='outline']:hover,
[data-slot='dialog-footer'] button[data-variant='outline']:hover,
[role='dialog']
  [data-slot='dialog-footer']
  button[data-variant='outline']:hover {
  border-color: rgba(210, 171, 99, 0.55);
  background: rgba(210, 171, 99, 0.12);
  color: #e8c97a;
}

/* 主操作按钮（"施放"、"确认准备"等） */
[role='dialog']
  [data-slot='dialog-footer']
  button:not([data-variant='outline']):not(.rest-button),
[data-slot='dialog-footer']
  button:not([data-variant='outline']):not(.rest-button) {
  background: linear-gradient(135deg, #5a3a18, #3d2510);
  border: 1px solid rgba(210, 171, 99, 0.35);
  color: #f0dfa0;
}
[role='dialog']
  [data-slot='dialog-footer']
  button:not([data-variant='outline']):not(.rest-button):hover,
[data-slot='dialog-footer']
  button:not([data-variant='outline']):not(.rest-button):hover {
  background: linear-gradient(135deg, #6e4820, #4a2e14);
  border-color: rgba(210, 171, 99, 0.6);
}

/* kicker 标签 */
.dialog-kicker {
  color: rgba(210, 171, 99, 0.6);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* 弹窗内通用段落文字 */
[role='dialog'] p {
  color: #c8b8a8;
}

/* spell-detail-block 标题 */
.spell-detail-block h5 {
  color: #e8c97a;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 5px;
}

/* spell-detail-block 内容 */
.spell-detail-block p,
.spell-detail-block li {
  color: #c8b8a8;
}

/* 法术准备弹窗描述中的 strong 颜色 */
.spell-prep-dialog strong {
  color: #f0dfa0;
}

/* 职业能力弹窗正文 */
.ability-detail-body p {
  color: #c8b8a8;
}

/* lore body 文字 */
.lore-body .lore-block p {
  color: #c8b8a8;
}
.lore-body .lore-block h5 {
  color: #e8c97a;
}

/* === 2026 layout refactor: persistent battle bar + tabbed sheet === */
.refactor-frame .right-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
}

.compact-hero-panel {
  margin-bottom: 0;
  padding-bottom: 14px;
}

.battle-status-bar {
  padding: 12px;
  margin-bottom: 0;
  border-radius: 22px;
  background: radial-gradient(
      circle at top left,
      rgba(210, 171, 99, 0.12),
      transparent 34%
    ), linear-gradient(180deg, rgba(38, 31, 32, 0.9), rgba(18, 17, 21, 0.94));
  border: 1px solid rgba(210, 171, 99, 0.16);
}

.battle-resource-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 1.45fr 1fr 1fr;
  gap: 10px;
}

.battle-resource {
  min-height: 68px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 18px;
  border: 1px solid rgba(210, 171, 99, 0.16);
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.94),
    rgba(25, 23, 27, 0.98)
  );
  color: var(--text-main);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

button.battle-resource {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms
    ease;
}

button.battle-resource:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 201, 122, 0.42);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.battle-resource span {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.battle-resource strong {
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  font-size: clamp(16px, 1.2vw, 22px);
  line-height: 1.1;
  color: #fff0d4;
  text-shadow: 0 0 16px rgba(210, 171, 99, 0.18);
}

.battle-resource small,
.compact-slot-line em {
  font-size: 11px;
  color: var(--text-soft);
  font-style: normal;
}

.hp-resource {
  background: linear-gradient(
    180deg,
    rgba(88, 30, 35, 0.94),
    rgba(31, 20, 24, 0.98)
  );
}

.concentration-resource {
  background: linear-gradient(
    180deg,
    rgba(35, 44, 68, 0.9),
    rgba(20, 23, 34, 0.98)
  );
}

.slots-resource,
.channel-resource,
.lay-resource {
  background: linear-gradient(
    180deg,
    rgba(56, 42, 28, 0.92),
    rgba(25, 22, 21, 0.98)
  );
}

.compact-slot-lines {
  display: grid;
  gap: 8px;
}

.compact-slot-line {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 8px;
}

.mini-orbs {
  gap: 6px;
  flex-wrap: wrap;
}

.mini-orbs .orb {
  width: 13px;
  height: 13px;
}

.resource-dot-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.resource-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(210, 171, 99, 0.28);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.resource-dot.active {
  background: radial-gradient(
    circle at 35% 30%,
    #fff6cf,
    #d2ab63 48%,
    #654519 100%
  );
  box-shadow: 0 0 16px rgba(210, 171, 99, 0.45);
}

.resource-dot.used {
  opacity: 0.36;
  background: rgba(255, 255, 255, 0.05);
}

.rest-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.short-rest-button,
.long-rest-button {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.short-rest-button {
  border-color: rgba(88, 132, 190, 0.35);
  color: #cfe1ff;
  background: linear-gradient(
    180deg,
    rgba(32, 49, 75, 0.84),
    rgba(17, 24, 38, 0.96)
  );
}

.stacked-rest-action-row {
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.stacked-rest-action-row .long-rest-button,
.stacked-rest-action-row .short-rest-button {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1;
}

.stacked-rest-action-row .long-rest-button {
  background: linear-gradient(
    180deg,
    rgba(168, 118, 44, 0.96),
    rgba(96, 59, 21, 1)
  );
  border-color: rgba(237, 201, 124, 0.42);
  color: #fff3d1;
}

.stacked-rest-action-row .short-rest-button {
  background: linear-gradient(
    180deg,
    rgba(35, 58, 98, 0.88),
    rgba(16, 28, 51, 0.98)
  );
}

.rest-resource {
  justify-content: center;
}

.sheet-tab-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  position: sticky;
  top: -18px;
  z-index: 5;
  padding: 8px 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    #151519 15%,
    #151519 85%,
    transparent 100%
  );
}

.sheet-tab {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(210, 171, 99, 0.14);
  background: linear-gradient(
    180deg,
    rgba(42, 35, 36, 0.86),
    rgba(24, 22, 27, 0.92)
  );
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms
    ease;
}

.sheet-tab:hover,
.sheet-tab.active {
  transform: translateY(-1px);
  border-color: rgba(232, 201, 122, 0.48);
  background: linear-gradient(
    180deg,
    rgba(82, 45, 31, 0.9),
    rgba(39, 26, 25, 0.96)
  );
}

.sheet-tab span {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.sheet-tab strong {
  font-size: 15px;
  color: #fff0d4;
}

.tab-panel {
  display: grid;
  gap: 18px;
}

.static-combat-rack {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
  gap: 12px;
}

.static-combat-rack .medallion {
  padding: 14px 12px 12px;
}

.static-combat-rack .medallion-name {
  font-size: 12px;
}

.static-combat-rack .medallion strong {
  margin: 8px 0 6px;
  font-size: 34px;
  line-height: 1;
}

.static-combat-rack .medallion small {
  font-size: 11px;
  line-height: 1.4;
}

.save-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.save-card {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.92),
    rgba(28, 26, 30, 0.96)
  );
  border: 1px solid rgba(210, 171, 99, 0.14);
}

.save-card span,
.save-card small {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
}

.save-card strong {
  display: block;
  margin: 5px 0;
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: #fff0d4;
}

.condition-board {
  display: grid;
  gap: 12px;
}

.active-condition-line,
.condition-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-condition-line span,
.condition-buttons button,
.normal-condition {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(210, 171, 99, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.condition-buttons button {
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.condition-buttons button.active,
.active-condition-line span:not(.normal-condition) {
  border-color: rgba(210, 171, 99, 0.42);
  color: #ffe7b5;
  background: rgba(142, 42, 50, 0.22);
}

.normal-condition {
  color: #bde3aa;
  border-color: rgba(120, 180, 100, 0.28);
  background: rgba(70, 120, 52, 0.14);
}

.resource-dialog {
  width: min(620px, calc(100vw - 24px));
  max-width: 620px;
}

.resource-dialog-list {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}

.resource-dialog-option {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(210, 171, 99, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  text-align: left;
}

.resource-dialog-option.clear {
  color: #ffc3c3;
  border-color: rgba(180, 80, 80, 0.24);
}

.resource-dialog-option small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
}

.resource-dialog-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(210, 171, 99, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.hit-dice-controls {
  display: grid;
  gap: 12px;
}

.short-rest-result {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(120, 180, 100, 0.22);
  background: rgba(70, 120, 52, 0.12);
}

.short-rest-result strong {
  color: #d8ffc7;
}

.short-rest-result p {
  margin-top: 6px;
  font-size: 13px;
}

.companion-accordion {
  display: grid;
  gap: 12px;
}

.companion-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.companion-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 28px;
  background: radial-gradient(
    circle at 30% 25%,
    rgba(255, 255, 255, 0.16),
    rgba(210, 171, 99, 0.12) 44%,
    rgba(43, 26, 16, 0.94)
  );
  border: 1px solid rgba(210, 171, 99, 0.22);
}

.companion-toggle strong {
  display: block;
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  color: #fff0d4;
  font-size: 18px;
}

.companion-toggle small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.companion-toggle em {
  color: var(--gold);
  font-style: normal;
  font-size: 12px;
}

.companion-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(210, 171, 99, 0.12);
  display: grid;
  gap: 10px;
}

.companion-statline {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: #fff0d4;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.dice-result-panel p {
  margin: 0;
}

@media (max-width: 1540px) {
  .battle-resource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .static-combat-rack,
  .save-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .battle-resource-grid,
  .sheet-tab-list,
  .static-combat-rack,
  .save-grid,
  .rest-action-row {
    grid-template-columns: 1fr;
  }

  .sheet-tab-list {
    position: relative;
    top: auto;
  }

  .battle-resource {
    min-height: auto;
  }
}

/* UI restoration adjustments */
.stage-header {
  padding: 20px 26px 10px;
}

.stage-kicker {
  margin-bottom: 6px;
  color: rgba(210, 171, 99, 0.72);
}

.stage-header h1 {
  font-size: clamp(38px, 4.1vw, 58px);
  letter-spacing: 0.055em;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.58);
}

.stage-subline {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(235, 204, 144, 0.9);
}

.stage-status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.stage-status-tags span {
  padding: 5px 10px;
  border-radius: 999px;
  color: rgba(242, 237, 228, 0.92);
  background: rgba(210, 171, 99, 0.08);
  border: 1px solid rgba(210, 171, 99, 0.2);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.battle-resource-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(
      0,
      0.9fr
    ) minmax(0, 0.9fr) minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: stretch;
  overflow: hidden;
}

.condition-resource {
  cursor: pointer;
}

.rest-resource {
  cursor: default;
}

.condition-resource strong {
  font-size: clamp(15px, 1vw, 20px);
  line-height: 1.25;
}

.compact-condition-buttons {
  gap: 5px;
  margin-top: 7px;
}

.compact-condition-buttons button {
  min-height: 25px;
  padding: 4px 7px;
  font-size: 11px;
}

.inline-rest-action-row {
  margin: 7px 0 6px;
}

.inline-rest-action-row .short-rest-button,
.inline-rest-action-row .long-rest-button {
  min-height: 34px;
  padding: 0 10px;
}

.attr-list {
  flex: 6 1;
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.attr-row {
  display: grid;
  grid-template-columns: 92px minmax(260px, 1fr);
  gap: 8px 14px;
  align-items: center;
  padding: 11px 14px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(44, 37, 38, 0.92),
    rgba(28, 26, 30, 0.96)
  );
  border: 1px solid rgba(210, 171, 99, 0.14);
}

.attr-row.highest-attribute {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--attribute-highest) 18%, rgba(44, 37, 38, 0.92)),
    rgba(31, 21, 24, 0.96)
  );
  border-color: color-mix(in srgb, var(--attribute-highest) 48%, transparent);
  box-shadow: inset 3px 0 0 var(--attribute-highest);
}

.attr-row-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.attr-row-name span {
  font-family: 'Cinzel', serif;
  color: var(--attribute-base);
  font-size: 14px;
  letter-spacing: 0.08em;
  width: 36px;
  flex-shrink: 0;
}

.attr-row-name strong {
  font-size: 15px;
  color: var(--text-hi);
}

.attr-row.highest-attribute .attr-row-name span,
.attr-row.highest-attribute .attr-row-name strong,
.attr-row.highest-attribute .attr-row-metrics strong {
  color: var(--attribute-highest);
}

.attr-row-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.attr-row-metrics span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(210, 171, 99, 0.12);
  font-size: 12px;
}

.attr-row-metrics strong {
  font-family: 'Cinzel', serif;
  color: var(--text-hi);
  font-size: 14px;
}

.attr-row-metrics .attr-save-inline {
  color: rgba(210, 171, 99, 0.82);
  border-color: rgba(210, 171, 99, 0.22);
}

.attr-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.5;
}

.feature-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.feature-stack .ability-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-stack .feat-panels {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.spell-dual-layout {
  align-items: stretch;
}

.spell-dual-layout > * {
  align-self: stretch;
  margin-top: 0;
}

.spell-dual-layout .feedback-banner {
  min-height: 100%;
}

.companion-profile {
  display: grid;
  gap: 14px;
}

.companion-profile-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

.companion-portrait-slot {
  min-height: 170px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(
    circle at 50% 24%,
    rgba(210, 171, 99, 0.18),
    rgba(12, 12, 16, 0.78)
  );
  border: 1px solid rgba(210, 171, 99, 0.2);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.26);
}

.companion-portrait-slot span {
  display: block;
  font-size: 64px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.36));
}

.companion-portrait-slot small {
  margin-top: -42px;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.companion-ability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.compact-companion-ability-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.compact-companion-ability {
  position: relative;
  padding: 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.compact-companion-ability .stat-value-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
}

.compact-companion-ability span {
  font-size: 11px;
}

.compact-companion-ability strong {
  font-size: 20px;
}

.compact-companion-ability small {
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: #e91e8c;
  font-size: 11px;
}

.companion-ability {
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(210, 171, 99, 0.14);
  padding: 10px;
}

.companion-ability span {
  color: rgba(210, 171, 99, 0.88);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.companion-ability strong {
  font-family: 'Cinzel', serif;
  color: var(--text-hi);
  font-size: 26px;
}

.companion-ability small {
  color: var(--text-soft);
}

.companion-trait-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.companion-trait-card,
.companion-bond-story {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(210, 171, 99, 0.14);
  padding: 13px 14px;
}

.companion-trait-card h5,
.companion-bond-story span {
  display: block;
  margin: 0 0 6px;
  color: rgba(232, 201, 122, 0.94);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.companion-trait-card p,
.companion-bond-story p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 1540px) {
  .battle-resource-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .feature-stack .ability-grid,
  .companion-trait-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .attr-row,
  .companion-profile-top {
    grid-template-columns: 1fr;
  }

  .attr-row-metrics,
  .feature-stack .ability-grid,
  .feature-stack .feat-panels,
  .companion-trait-cards {
    grid-template-columns: 1fr;
  }

  .compact-companion-ability-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.condition-dialog-option.active {
  border-color: rgba(210, 171, 99, 0.5);
  background: rgba(142, 42, 50, 0.24);
  color: #ffe7b5;
}

.condition-dialog-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.condition-dialog-list .clear {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .condition-dialog-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  html {
    zoom: 1;
  }

  body {
    overflow-x: hidden;
  }

  .ui-frame {
    width: 100%;
    margin: 0;
    padding: 8px;
    gap: 12px;
  }

  .panel-frame {
    border-radius: 22px;
  }

  .ornate-frame::before,
  .ornate-frame::after {
    inset: 8px;
  }

  .left-stage,
  .right-stage {
    height: auto;
  }

  .right-stage {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .stage-header {
    padding: 18px 18px 8px;
  }

  .stage-header h1 {
    font-size: clamp(30px, 9vw, 40px);
    line-height: 1.02;
  }

  .stage-subtitle,
  .hero-subtitle {
    font-size: 14px;
  }

  .portrait-wrap {
    min-height: 0;
    padding: 0 4px 6px;
  }

  .portrait {
    height: min(70vh, 520px);
    max-height: 520px;
  }

  .crest-row,
  .combat-rack,
  .footer-ribbon,
  .skill-grid,
  .compact-companion-ability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-status-bar {
    padding: 10px;
    border-radius: 18px;
  }

  .battle-resource-grid,
  .static-combat-rack,
  .save-grid,
  .feature-stack .ability-grid,
  .feature-stack .feat-panels,
  .companion-trait-cards,
  .condition-dialog-list,
  .sheet-tab-list {
    grid-template-columns: 1fr;
  }

  .battle-resource,
  .sheet-tab {
    min-height: 56px;
  }

  .battle-resource {
    padding: 10px 12px;
  }

  .battle-resource strong {
    font-size: 18px;
  }

  .sheet-tab-list {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    z-index: 30;
    gap: 8px;
    padding: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 18px;
    border: 1px solid rgba(210, 171, 99, 0.18);
    background: linear-gradient(
      180deg,
      rgba(21, 21, 25, 0.96) 0%,
      rgba(21, 21, 25, 0.92) 100%
    );
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
  }

  .sheet-tab {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .sheet-tab span {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .sheet-tab strong {
    font-size: 14px;
  }

  .hero-panel,
  .section-block {
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .section-title-bar h3,
  .subhead h3,
  .hero-title {
    font-size: 24px;
  }

  .section-tip {
    max-width: none;
    text-align: left;
  }

  .stats-layout {
    min-height: 0;
    gap: 12px;
    flex-direction: column;
  }

  .radar-card {
    min-height: 0;
    padding: 18px 12px 20px;
  }

  .radar-svg {
    width: min(100%, 300px);
  }

  .attr-row {
    padding: 12px;
    gap: 10px;
  }

  .attr-row-name {
    flex-wrap: wrap;
  }

  .attr-row-metrics {
    grid-template-columns: 1fr;
  }

  .attr-row-metrics span {
    min-height: 34px;
  }

  .ability-chip,
  .feat-panel,
  .gear-slot,
  .mini-card,
  .spell-panel,
  .companion-card,
  .companion-trait-card,
  .companion-bond-story {
    padding: 12px;
  }

  .aura-banner {
    flex-direction: column;
  }

  .aura-mark {
    width: 56px;
    height: 56px;
  }

  .gear-slot {
    min-height: 0;
  }

  .spell-dialog,
  .spell-prep-dialog,
  .dice-dialog,
  .lore-dialog,
  .ability-detail-dialog,
  .resource-dialog,
  .hp-dialog {
    width: min(100vw - 16px, 640px);
    max-width: min(100vw - 16px, 640px);
    padding-left: 14px;
    padding-right: 14px;
  }

  [data-slot='dialog-content'][role='dialog'],
  [role='dialog'] [data-slot='dialog-content'] {
    max-height: min(88vh, 820px);
    border-radius: 20px;
  }

  .hp-dialog-body,
  .resource-dialog-list,
  .dice-dialog-body,
  .spell-dialog-body {
    max-height: 60vh;
  }

  .hp-dialog-actions,
  .dialog-kicker-row,
  .spell-dialog-footer,
  .dice-expression-row,
  .dice-quick-layout,
  .interactive-layout,
  .spell-dual-layout {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .spell-dialog-footer button,
  .hp-dialog-actions .hp-action-button,
  .rest-action-row button,
  .dice-fab,
  .spell-cast-btn,
  .spell-secondary-btn,
  .resource-dialog-option,
  .condition-buttons button,
  .companion-toggle {
    min-height: 44px;
  }

  .dice-fab-wrap {
    right: 12px;
    bottom: auto;
    top: calc(var(--safe-area-top, 0px) + 12px);
  }

  .dice-fab {
    padding: 12px 14px;
  }

  .companion-toggle {
    grid-template-columns: auto 1fr;
  }

  .companion-toggle em {
    grid-column: 1 / -1;
    padding-left: 64px;
  }
}


/*# sourceMappingURL=main.css.map*/