/* ================================================================
   大壮群英杀 · 万世对决 — 基础层（设计变量 / 重置 / 全局）
   负责人：Lead。UI 只需消费这里的 CSS 变量，不要修改本文件。
   ================================================================ */

:root {
  /* 墨色底 */
  --ink-0: #05060a;
  --ink-1: #0a0d15;
  --ink-2: #111623;
  --ink-3: #1a2233;
  --ink-4: #252f45;

  /* 金 / 朱 / 玉 */
  --gold: #e8c37a;
  --gold-bright: #ffe3a3;
  --gold-deep: #a97d3c;
  --gold-line: rgba(232, 195, 122, 0.22);
  --gold-glow: rgba(232, 195, 122, 0.34);
  --red: #e05a4f;
  --red-bright: #ff7a6c;
  --red-deep: #8f2f2a;
  --blue: #5b8def;
  --blue-bright: #8ab4ff;
  --purple: #b978e8;
  --green: #4fd6b8;
  --green-bright: #7ff0d5;

  /* 文本 */
  --text: #f2ebdc;
  --text-dim: #a99e88;
  --text-faint: #6d6557;

  /* 功能色 */
  --hp: #e05a4f;
  --shadow-0: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-1: 0 8px 28px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 24px rgba(232, 195, 122, 0.28);

  /* 字体 */
  --font-title: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-num: "Avenir Next", "DIN Alternate", "Futura", system-ui, sans-serif;

  /* 尺寸 */
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;
  --radius-card: 10px;

  /* 层级 */
  --z-table: 10;
  --z-seat: 20;
  --z-hand: 30;
  --z-panel: 40;
  --z-modal: 60;
  --z-banner: 80;
  --z-toast: 90;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink-0);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation; /* 避免双击缩放，卡片点击更跟手 */
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* 移动端浏览器地址栏伸缩时更准确 */
  overflow: hidden;
  isolation: isolate;
}

/* 全局氛围底：墨色 + 隐约金红光晕 */
#app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(232, 195, 122, 0.10), transparent 55%),
    radial-gradient(80% 60% at 12% 100%, rgba(224, 90, 79, 0.10), transparent 60%),
    radial-gradient(70% 60% at 92% 88%, rgba(91, 141, 239, 0.10), transparent 60%),
    linear-gradient(180deg, #080a11 0%, #05060a 100%);
  pointer-events: none;
}

/* 细密星尘（纯 CSS，不依赖图片） */
#app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 227, 163, 0.5), transparent 100%),
    radial-gradient(1px 1px at 70% 18%, rgba(255, 227, 163, 0.35), transparent 100%),
    radial-gradient(1.5px 1.5px at 46% 62%, rgba(255, 255, 255, 0.25), transparent 100%),
    radial-gradient(1px 1px at 84% 54%, rgba(255, 227, 163, 0.3), transparent 100%),
    radial-gradient(1px 1px at 33% 84%, rgba(143, 180, 255, 0.32), transparent 100%),
    radial-gradient(1px 1px at 12% 70%, rgba(255, 255, 255, 0.18), transparent 100%);
  opacity: 0.8;
  pointer-events: none;
}

button { font-family: inherit; }
input, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
::-webkit-scrollbar-thumb { background: rgba(232, 195, 122, 0.28); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232, 195, 122, 0.5); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 通用文字风格 */
.font-title { font-family: var(--font-title); letter-spacing: 0.08em; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
