/* ========== 花雾 UI v2 · 主题令牌 ========== */
/* token 全局；组件样式先限定在战斗页，避免动到菜单。 */

:root {
  /* 不要覆盖 main.css 的 --ink（正文文字色）；这里用 --night 表示深底。 */
  --night: #0a0d0b;
  --lacquer: #16110d;
  --paper: #e8dcc0;
  --gilt: #c8a96a;
  --cinnabar: #a33a2c;
  --jade: #6f8f7a;
  --fog: #9fb3a8;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;
  --gap-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
}

body {
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.battle .panel {
  background: var(--lacquer);
  border: 1px solid var(--gilt);
  border-radius: var(--r-sm);
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 rgba(232, 220, 192, 0.08);
  color: var(--paper);
}

body.battle .panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}

.danger {
  color: var(--cinnabar);
  border-color: var(--cinnabar);
}

.safe {
  color: var(--jade);
  border-color: var(--jade);
}

/* 低命火效果：全屏红色暗角，不挡输入。 */
body.low-health::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 26%, rgba(163, 58, 44, 0.3) 100%);
  animation: heartbeat 1.2s ease-in-out infinite;
  z-index: 999;
}

@keyframes heartbeat {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body.low-health::after {
    animation: none;
    opacity: 0.4;
  }
}
