/* 乌托邦疗养院 · 1926 阿尔卑斯悬疑 RPG 界面系统（平板沙盘 + 个人客户端共用）
 * 美术基调：深胡桃黑漆铭牌 × 做旧香槟黄铜双线框 × 切角菱形榫卯 × 全屏厚涂原画立绘
 * 性能铁律：WebGL 画布上方严禁使用 backdrop-filter，全部边框/角标/质感均以零额外贴图开销的纯 CSS 绘制。
 */
:root {
  /* ---- 色板（克制：黑漆 + 香槟黄铜唯一主强调 + 羊皮纸墨白） ---- */
  --c-bg: #0c0a08;
  --c-obsidian: #13100d;
  --c-panel: rgba(16, 13, 10, 0.88);
  --c-panel-hi: rgba(18, 15, 11, 0.96);
  --c-panel-lo: rgba(15, 12, 9, 0.72);
  --c-hover: rgba(214, 179, 114, 0.11);
  --c-press: rgba(214, 179, 114, 0.2);

  --c-line: rgba(212, 177, 114, 0.24);
  --c-line-hi: rgba(226, 193, 132, 0.52);
  --c-line-dim: rgba(235, 224, 200, 0.11);

  --c-fg: #f2ead8;
  --c-fg-2: rgba(242, 234, 216, 0.74);
  --c-fg-3: rgba(242, 234, 216, 0.48);

  --c-accent: #cca562;
  --c-accent-hi: #e5c483;
  --c-accent-lo: #98753b;
  --c-accent-ink: #16110a;
  --c-accent-soft: rgba(204, 165, 98, 0.16);

  --c-ok: #8ab382;
  --c-wait: #d7ab59;
  --c-danger: #c0563e;
  --c-danger-soft: rgba(166, 65, 45, 0.92);
  --c-cold: #89abc9;
  --c-cold-bg: rgba(28, 44, 64, 0.95);

  --c-paper: #f1e8d4;
  --c-paper-ink: #241d15;

  /* ---- 字体：衬线作标题/名牌/立绘铭文，无衬线作紧凑操作控件 ---- */
  --f-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --f-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --f-num: Georgia, "Times New Roman", serif;
  --f-mono: ui-monospace, Menlo, monospace;

  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --tr: 0.04em;
  --tr-title: 0.34em;

  /* ---- 锐利建筑切角（去圆角 SaaS 胶囊感） ---- */
  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 5px;
  --r-pill: 999px;
  --tap: 44px;
  --ic: 18px;
  --ic-stroke: 1.7;

  /* ---- 金属漆面层次阴影 ---- */
  --sh-1: 0 6px 20px rgba(0, 0, 0, 0.46), 0 1px 3px rgba(0, 0, 0, 0.5);
  --sh-2: 0 18px 50px rgba(0, 0, 0, 0.68), 0 4px 12px rgba(0, 0, 0, 0.45);
  --sh-brass: inset 0 1px 0 rgba(255, 241, 206, 0.16), inset 0 0 0 1px rgba(212, 177, 114, 0.12);

  /* ---- 动效（Web Animation Design：干脆利落 ease-out-quart，≤ 240ms） ---- */
  --t-fast: 130ms;
  --t-base: 210ms;
  --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* ---- 安全区 ---- */
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);
  --edge: 12px;
}
@media (max-width: 520px), (max-height: 520px) { :root { --edge: 8px; } }

html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--c-bg); color: var(--c-fg);
  font-family: var(--f-sans); font-size: var(--fs-md); letter-spacing: var(--tr);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-synthesis: weight;
  touch-action: none; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; letter-spacing: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-accent-hi); outline-offset: 2px; }

.ic { width: var(--ic); height: var(--ic); flex: none; display: block; stroke-width: var(--ic-stroke); }

/* =====================================================================
 * 核心游戏面板：黑漆底 + 做旧黄铜细框 + 四角精雕黄铜角标（纯 CSS，0 贴图）
 * ===================================================================== */
.u-panel {
  position: relative;
  background:
    /* 四角 7px 黄铜 L 形角标 */
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 7px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 1px 7px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 0 / 7px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 0 / 1px 7px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 100% / 7px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 100% / 1px 7px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 7px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 1px 7px no-repeat,
    linear-gradient(180deg, rgba(25, 21, 16, 0.92) 0%, rgba(13, 11, 9, 0.95) 100%);
  border: 1px solid var(--c-line);
  border-radius: var(--r-xs);
  box-shadow: var(--sh-1), var(--sh-brass);
}

/* ---- 游戏控件按钮 ---- */
.u-btn {
  appearance: none; border: 0; background: transparent; color: var(--c-fg-2); cursor: pointer;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: var(--tap); min-height: var(--tap); padding: 0 14px; border-radius: var(--r-xs);
  font-size: var(--fs-md); white-space: nowrap; touch-action: manipulation;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.u-btn .ic { --ic: 16px; }
@media (hover: hover) {
  .u-btn:hover { background: var(--c-hover); color: var(--c-fg); }
}
.u-btn:active, .u-btn.down { background: var(--c-press); color: var(--c-fg); transform: translateY(1px); }
.u-btn.on {
  color: var(--c-accent-hi);
  background: linear-gradient(180deg, rgba(204, 165, 98, 0.16) 0%, rgba(204, 165, 98, 0.06) 100%);
  box-shadow: inset 0 -2px 0 var(--c-accent), inset 0 1px 0 rgba(255, 240, 200, 0.14);
}
.u-btn.warn { background: var(--c-danger-soft); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 215, 200, 0.25); }
.u-btn.disabled { opacity: 0.38; }

/* 独立铭牌按钮 */
.u-btn.solo {
  background:
    linear-gradient(var(--c-accent), var(--c-accent)) 0 0 / 5px 1px no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) 0 0 / 1px 5px no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) 100% 100% / 5px 1px no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) 100% 100% / 1px 5px no-repeat,
    linear-gradient(180deg, rgba(26, 22, 17, 0.92) 0%, rgba(14, 11, 9, 0.95) 100%);
  border: 1px solid var(--c-line);
  box-shadow: var(--sh-1), var(--sh-brass);
  color: var(--c-fg);
}
@media (hover: hover) {
  .u-btn.solo:hover { border-color: var(--c-line-hi); color: var(--c-accent-hi); }
}
.u-btn.solo:active, .u-btn.solo.on { background: rgba(46, 38, 27, 0.95); border-color: var(--c-accent); transform: translateY(1px); }
.u-btn.primary {
  background: linear-gradient(180deg, var(--c-accent-hi) 0%, var(--c-accent) 100%);
  border: 1px solid rgba(255, 240, 200, 0.45);
  color: var(--c-accent-ink); font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 250, 232, 0.45);
}
.u-btn.primary:active { filter: brightness(1.06); transform: translateY(1px); }
.u-btn.danger {
  background: linear-gradient(180deg, #b84b34 0%, #8e3522 100%);
  border: 1px solid rgba(240, 170, 150, 0.35);
  color: #fff; font-weight: 500;
}

/* ---- 工具条：菱形黄铜铆钉分隔 ---- */
.u-bar { display: flex; align-items: center; gap: 2px; padding: 3px 4px; }
.u-bar .sep {
  width: 4px; height: 4px; margin: 0 7px; flex: none;
  background: var(--c-accent); opacity: 0.55; transform: rotate(45deg);
}

/* ---- 关闭按钮 ---- */
.u-close {
  appearance: none; border: 0; background: transparent; color: var(--c-fg-3); cursor: pointer;
  position: absolute; right: 4px; top: 4px; width: var(--tap); height: var(--tap); border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center; touch-action: manipulation;
  transition: color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.u-close .ic { --ic: 18px; }
.u-close:active { background: var(--c-hover); color: var(--c-accent-hi); }
@media (hover: hover) { .u-close:hover { color: var(--c-accent-hi); } }

/* ---- 游戏主徽标标题 ---- */
.u-title {
  display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0;
  font-family: var(--f-serif); font-size: var(--fs-2xl); font-weight: 600;
  letter-spacing: var(--tr-title); color: #f7efe0; white-space: nowrap;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85), 0 0 24px rgba(204, 165, 98, 0.25);
}
.u-title > span { margin-right: calc(-1 * var(--tr-title)); }
.u-title::before, .u-title::after {
  content: ''; width: 42px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-accent-hi)); opacity: 0.82;
}
.u-title::after { background: linear-gradient(90deg, var(--c-accent-hi), transparent); }
.u-sub {
  font-family: var(--f-serif); font-size: var(--fs-sm); color: var(--c-accent-hi);
  letter-spacing: 0.26em; opacity: 0.88; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

/* ---- 进度条：锋利金刃进度槽 ---- */
.u-track {
  position: relative; height: 3px; border-radius: 1px;
  background: rgba(242, 234, 216, 0.12);
  border: 1px solid rgba(212, 177, 114, 0.22);
  overflow: visible;
}
.u-track > div {
  position: relative; width: 0; height: 100%;
  background: linear-gradient(90deg, var(--c-accent-lo) 0%, var(--c-accent) 60%, #f5dfa8 100%);
  box-shadow: 0 0 10px rgba(229, 196, 131, 0.55);
  transition: width var(--t-base) linear;
}
.u-track > div::after {
  content: ''; position: absolute; right: -3px; top: 50%; width: 6px; height: 6px;
  background: #fff2ce; transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 0 8px rgba(245, 223, 168, 0.9);
}

/* ---- 状态宝石点 & 菱形角色徽记 ---- */
.u-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c-fg-3); }
.u-dot.on, .u-dot.online { background: var(--c-ok); box-shadow: 0 0 8px rgba(138, 179, 130, 0.75); }
.u-dot.wait, .u-dot.connecting { background: var(--c-wait); animation: u-breathe 1.6s ease-in-out infinite; }
.u-dot.off, .u-dot.offline { background: var(--c-danger); }
@keyframes u-breathe { 50% { opacity: 0.35; } }
.u-swatch {
  width: 8px; height: 8px; border-radius: 1px; flex: none; transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(255, 245, 220, 0.45), 0 0 6px rgba(0, 0, 0, 0.5);
}

/* ---- 3D 人物名牌：黑漆金边铭牌 ---- */
.tag {
  display: flex; align-items: center; gap: 7px; padding: 3px 10px 4px 8px; border-radius: var(--r-xs);
  background: linear-gradient(180deg, rgba(22, 18, 14, 0.9) 0%, rgba(12, 10, 8, 0.92) 100%);
  border: 1px solid rgba(212, 177, 114, 0.34);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 200, 0.1);
  color: var(--c-fg); font-family: var(--f-serif); font-size: var(--fs-sm); font-weight: 600;
  letter-spacing: 0.08em; line-height: 1.25; white-space: nowrap; pointer-events: none; max-width: 12em;
}
.tag > i {
  width: 7px; height: 7px; border-radius: 1px; flex: none; transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(255, 245, 220, 0.45);
}
.tag .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---- 头顶动作气泡：旧羊皮纸手账便签 ---- */
.bubble {
  position: relative; padding: 4px 12px 5px; border-radius: var(--r-xs); white-space: nowrap; pointer-events: none;
  background: linear-gradient(180deg, #f6eedc 0%, #e7d9bc 100%);
  border: 1px solid rgba(74, 56, 34, 0.55);
  color: var(--c-paper-ink); font-family: var(--f-serif); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.08em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 252, 244, 0.6);
}
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -4px; width: 7px; height: 7px;
  background: #e7d9bc; border-right: 1px solid rgba(74, 56, 34, 0.55); border-bottom: 1px solid rgba(74, 56, 34, 0.55);
  transform: rotate(45deg);
}
@keyframes u-rise { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes u-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- 游戏通知横幅 ---- */
.u-banner {
  display: flex; align-items: center; gap: 9px; padding: 8px 18px; border-radius: var(--r-xs); pointer-events: none;
  font-size: var(--fs-sm); line-height: 1.45; letter-spacing: 0.08em;
  background:
    linear-gradient(var(--c-accent), var(--c-accent)) 0 50% / 3px 14px no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) 100% 50% / 3px 14px no-repeat,
    linear-gradient(180deg, rgba(22, 18, 14, 0.94) 0%, rgba(12, 10, 8, 0.96) 100%);
  border: 1px solid var(--c-line); box-shadow: var(--sh-1), var(--sh-brass); color: var(--c-fg);
  width: max-content; max-width: calc(100vw - var(--sa-l) - var(--sa-r) - 2 * var(--edge) - 8px); box-sizing: border-box;
}
.u-banner .ic { --ic: 16px; color: var(--c-accent-hi); }
.u-banner.cold {
  background: linear-gradient(180deg, rgba(32, 50, 74, 0.95) 0%, rgba(20, 33, 50, 0.97) 100%);
  border-color: rgba(137, 171, 201, 0.55);
}
.u-banner.cold .ic { color: #b5d3ed; }
.u-banner.alarm {
  background: linear-gradient(180deg, rgba(158, 58, 39, 0.95) 0%, rgba(118, 40, 26, 0.97) 100%);
  border-color: rgba(255, 200, 180, 0.35); color: #fff;
}
.u-banner.alarm .ic { color: #ffd9cc; }

/* ---- 金属键帽 ---- */
kbd, .u-kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.55em; height: 1.55em; padding: 0 0.38em; box-sizing: border-box;
  background: rgba(212, 177, 114, 0.1);
  border: 1px solid var(--c-line-hi); border-bottom-width: 2px; border-radius: 2px;
  font: 600 0.78em/1 var(--f-mono); letter-spacing: 0; color: var(--c-accent-hi); vertical-align: 0.06em;
}

/* ---- 弹层与羊皮/黑漆契约卡片 ---- */
.u-modal {
  position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center;
  padding: calc(var(--sa-t) + var(--edge)) calc(var(--sa-r) + var(--edge)) calc(var(--sa-b) + var(--edge)) calc(var(--sa-l) + var(--edge));
  box-sizing: border-box; background: rgba(6, 5, 4, 0.72);
}
.u-modal.show { display: flex; animation: u-fade var(--t-base) var(--ease-out); }
.u-modal.show > .u-sheet { animation: u-rise var(--t-base) var(--ease-out); }
.u-sheet {
  position: relative; box-sizing: border-box; max-width: 100%; max-height: 100%; overflow: auto;
  background:
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 12px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 1px 12px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 0 / 12px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 0 / 1px 12px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 100% / 12px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 100% / 1px 12px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 12px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 1px 12px no-repeat,
    linear-gradient(180deg, rgba(24, 20, 15, 0.97) 0%, rgba(13, 11, 9, 0.98) 100%);
  border: 1px solid var(--c-line-hi); border-radius: var(--r-xs);
  box-shadow: var(--sh-2), inset 0 0 0 4px rgba(14, 11, 9, 0.9), inset 0 0 0 5px rgba(212, 177, 114, 0.16);
  color: var(--c-fg); touch-action: pan-y;
}

.credit { display: none; }

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

/* =====================================================================
 * 平板大屏（index.html）· 战略沙盘 HUD
 * ===================================================================== */
#title {
  font-family: var(--f-serif); font-size: 18px; font-weight: 600;
  letter-spacing: 0.28em; color: #f6eedc;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85); white-space: nowrap;
  padding-left: 12px;
  border-left: 2px solid var(--c-accent);
}
#title::before {
  content: 'NAGANO · 1926'; display: block;
  font-family: var(--f-num); font-size: 9px; font-weight: 400; letter-spacing: 0.34em;
  color: var(--c-accent-hi); opacity: 0.82; margin-bottom: 2px;
}
#title::after {
  content: ''; display: block; width: 42px; height: 1px; margin-top: 6px;
  background: linear-gradient(90deg, var(--c-accent), transparent);
}

/* 3D 房间铭牌：建筑档案铜牌 */
.label {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 12px 5px 10px; border-radius: var(--r-xs);
  white-space: nowrap; pointer-events: none;
  background:
    linear-gradient(var(--c-accent), var(--c-accent)) 0 50% / 2px 60% no-repeat,
    linear-gradient(180deg, rgba(20, 17, 13, 0.86) 0%, rgba(12, 10, 8, 0.9) 100%);
  border: 1px solid rgba(212, 177, 114, 0.3);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  color: var(--c-fg); font-family: var(--f-serif); font-size: var(--fs-md); font-weight: 500; letter-spacing: 0.14em;
}
.label b {
  font: 600 14px/1 var(--f-num); font-style: normal; color: var(--c-accent-hi); letter-spacing: 0;
  padding-right: 6px; border-right: 1px solid rgba(212, 177, 114, 0.25);
}

/* 棋子名牌状态 */
.ptag { display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; transition: opacity var(--t-base) var(--ease-out); }
.ptag .tag .ph { display: none; --ic: 12px; --ic-stroke: 2; width: 12px; height: 12px; margin: 0 -2px 0 1px; color: var(--c-ok); }
.ptag.phone .tag .ph { display: block; }
.ptag.phone .tag { border-color: rgba(138, 179, 130, 0.6); }
.ptag.dim .tag { opacity: 0.52; }
.ptag.lost .tag .ph { color: var(--c-wait); }
.ptag.following .tag { border-color: var(--c-accent-hi); box-shadow: 0 0 0 2px rgba(204, 165, 98, 0.38), 0 4px 14px rgba(0, 0, 0, 0.55); }
.ptag.occluded .tag { border-style: dashed; background: rgba(16, 13, 10, 0.44); color: rgba(242, 234, 216, 0.78); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.ptag.occluded:not(.phone):not(.following) .tag { border-color: rgba(212, 177, 114, 0.36); }
.ptag.occluded .tag > i { opacity: 0.6; }
.ptag.occluded.following .tag { box-shadow: 0 0 0 2px rgba(204, 165, 98, 0.22); }
.ptag.occluded .bubble { opacity: 0.82; }
.ptag .bubble { display: none; }
.ptag .bubble.show { display: block; animation: u-rise var(--t-base) var(--ease-out); }
.far .tag { padding: 4px; gap: 0; }
.far .tag .nm, .far .tag .ph { display: none !important; }
.far .bubble { font-size: var(--fs-xs); padding: 2px 8px 3px; }

/* 底部视角切换坞 & 右上角操作条 */
#views .u-btn { font-family: var(--f-serif); font-size: 15px; font-weight: 600; padding: 0 18px; letter-spacing: 0.16em; }
#views .u-btn.on::before {
  content: ''; position: absolute; top: 3px; left: 50%; width: 4px; height: 4px;
  background: var(--c-accent-hi); transform: translateX(-50%) rotate(45deg);
}
#toggles .u-btn, #kp .u-btn { font-size: var(--fs-sm); padding: 0 12px; letter-spacing: 0.08em; }
#kp .u-btn.shake { animation: u-nudge 190ms var(--ease-out); }
@keyframes u-nudge { 30% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
.net { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; min-height: var(--tap); font-size: var(--fs-xs); color: var(--c-fg-2); white-space: nowrap; letter-spacing: 0.08em; }
.net b { font-weight: 500; }
.net.on .u-dot { background: var(--c-ok); box-shadow: 0 0 8px rgba(138, 179, 130, 0.7); animation: none; }
.net.wait .u-dot { background: var(--c-wait); box-shadow: none; animation: u-breathe 1.6s ease-in-out infinite; }
.net.off .u-dot { background: var(--c-fg-3); box-shadow: none; animation: none; }
.net.off { color: var(--c-fg-3); }

.page-table #frozen b { font-family: var(--f-serif); font-weight: 600; letter-spacing: 0.2em; white-space: nowrap; }
.page-table #frozen span { color: rgba(236, 228, 211, 0.78); font-size: var(--fs-xs); }

.page-table #hint {
  gap: 0; align-items: center; text-align: center; font-size: var(--fs-xs); color: var(--c-fg-2);
  opacity: 0; transition: opacity var(--t-base) var(--ease-out); padding: 6px 14px;
}
.page-table #hint.show { opacity: 0.92; }
.page-table #hint i { font-style: normal; color: var(--c-accent); padding: 0 0.65em; opacity: 0.65; }
.page-table #hint span { white-space: nowrap; }

/* 手机加入（疗养院住客邀请函） */
#join .box { width: min(390px, 100%); padding: 26px 28px 22px; text-align: center; }
#join h2 {
  margin: 0 0 18px; font-family: var(--f-serif); font-size: var(--fs-xl); font-weight: 600;
  letter-spacing: 0.28em; color: var(--c-accent-hi);
}
#join .plate {
  display: inline-flex; padding: 12px; border-radius: var(--r-xs);
  background: #f7f2e6; border: 1px solid var(--c-accent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); max-width: 100%; box-sizing: border-box;
}
#join canvas { display: block; image-rendering: pixelated; max-width: 100%; max-height: min(56vh, 280px); height: auto !important; width: auto; aspect-ratio: 1; }
#join .url { margin-top: 14px; font: 12.5px/1.5 var(--f-mono); letter-spacing: 0; color: var(--c-accent-hi); word-break: break-all; user-select: text; -webkit-user-select: text; }
#join p { margin: 8px 0 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--c-fg-2); }
#join .a2hs { font-size: var(--fs-xs); color: var(--c-fg-3); }
#join .warn { color: #e89a84; }
#join .arr { color: var(--c-accent); padding: 0 0.35em; }
@media (max-height: 560px) and (min-width: 560px) {
  #join .box { width: min(600px, 100%); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: 22px; text-align: left; padding: 20px 24px; }
  #join h2 { grid-column: 2; margin: 4px 0 6px; padding-right: 36px; }
  #join .plate { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  #join canvas { max-height: calc(100vh - 110px); }
  #join .info { grid-column: 2; }
  #join .url { margin-top: 6px; }
}

/* 调查员档案浮卡 */
#card {
  width: 248px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 14px 16px;
  border-radius: var(--r-xs);
  background:
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 8px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 1px 8px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 8px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 1px 8px no-repeat,
    linear-gradient(180deg, rgba(24, 20, 15, 0.96) 0%, rgba(13, 11, 9, 0.98) 100%);
  border: 1px solid var(--c-line-hi); box-shadow: var(--sh-2), var(--sh-brass); color: var(--c-fg);
  opacity: 0; transform: translateY(5px); transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); pointer-events: none;
}
#card.show { opacity: 1; transform: none; pointer-events: auto; }
#card .head { display: flex; align-items: baseline; gap: 9px; padding-right: 34px; min-width: 0; }
#card .head i { width: 8px; height: 8px; border-radius: 1px; transform: rotate(45deg); flex: none; align-self: center; box-shadow: 0 0 0 1px rgba(255, 245, 220, 0.45); }
#card .head b { font-family: var(--f-serif); font-size: 17px; font-weight: 600; letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#card .head span { font-size: var(--fs-xs); color: var(--c-accent-hi); white-space: nowrap; }
#card p { margin: 9px 0 0; font-size: var(--fs-sm); line-height: 1.65; color: var(--c-fg-2); }
#card .who { margin-top: 7px; font-size: var(--fs-xs); } #card .who em { font-style: normal; color: var(--c-fg-3); } #card .who em.on { color: var(--c-ok); }
#card .tip { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--c-line-dim); font-size: var(--fs-xs); color: var(--c-fg-3); }

/* KP 指令面板 */
.actmenu {
  position: fixed; z-index: 16; display: none; width: min(356px, calc(100vw - 16px)); box-sizing: border-box; padding: 14px;
  border-radius: var(--r-xs);
  background:
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 10px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 1px 10px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 10px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 1px 10px no-repeat,
    linear-gradient(180deg, rgba(24, 20, 15, 0.96) 0%, rgba(13, 11, 9, 0.98) 100%);
  border: 1px solid var(--c-line-hi); box-shadow: var(--sh-2), var(--sh-brass); color: var(--c-fg);
}
.actmenu.show { display: block; animation: u-rise var(--t-base) var(--ease-out); }
.actmenu .h { display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 0 40px 6px 4px; border-bottom: 1px solid var(--c-line-dim); font-family: var(--f-serif); font-size: 17px; font-weight: 600; letter-spacing: 0.1em; }
.actmenu .h i { width: 8px; height: 8px; border-radius: 1px; transform: rotate(45deg); flex: none; box-shadow: 0 0 0 1px rgba(255, 245, 220, 0.45); }
.actmenu .h .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.actmenu .sec { margin: 12px 4px 7px; font-size: var(--fs-2xs); color: var(--c-accent); letter-spacing: 0.24em; }
.actmenu .row { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; }
.actmenu .row.ia { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.actmenu .row button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; min-width: 0; padding: 6px 4px;
  border-radius: var(--r-xs); border: 1px solid var(--c-line-dim);
  background: linear-gradient(180deg, rgba(255, 246, 224, 0.05) 0%, rgba(255, 246, 224, 0.02) 100%);
  color: var(--c-fg); cursor: pointer; touch-action: manipulation; font-size: var(--fs-sm);
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.actmenu .row button .ic { --ic: 19px; color: var(--c-accent-hi); }
.actmenu .row button > span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actmenu .row button small { font: 11px/1 var(--f-num); color: var(--c-fg-3); letter-spacing: 0; }
.actmenu .row button:active { background: var(--c-press); border-color: var(--c-accent); transform: scale(0.96); }
@media (hover: hover) { .actmenu .row button:hover { background: var(--c-hover); border-color: var(--c-line-hi); } }
.actmenu .none { grid-column: 1 / -1; padding: 4px 4px 2px; font-size: var(--fs-sm); color: var(--c-fg-3); }
.actmenu .off { margin: 10px 4px 0; font-size: var(--fs-xs); color: var(--c-wait); }
.actmenu, #card { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
@media (max-height: 520px) {
  .actmenu { padding: 8px 10px; }
  .actmenu .h { min-height: 28px; font-size: var(--fs-md); }
  .actmenu .sec { margin: 6px 4px 4px; font-size: 10px; }
  .actmenu .row button { min-height: 45px; gap: 1px; padding: 2px; }
  .actmenu .row button .ic { --ic: 17px; }
  .actmenu .row button small { display: none; }
}

/* =====================================================================
 * 电影感全屏标题加载页（index.html · #loading）
 * ===================================================================== */
#loading {
  display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: flex-end;
  padding: 0 28px calc(var(--sa-b) + 11vh); box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, 0.25) 0%, rgba(10, 8, 6, 0.15) 42%, rgba(10, 8, 6, 0.84) 76%, rgba(9, 7, 5, 0.97) 100%),
    url("../img/ui/bg-title.webp") center 38% / cover no-repeat,
    var(--c-bg);
  transition: opacity 360ms var(--ease-out);
}
#loading.done { opacity: 0; pointer-events: none; }
#loading .u-title { font-size: clamp(26px, 4.4vw, 40px); letter-spacing: 0.42em; }
#loading .u-title > span { margin-right: -0.42em; }
#loading .u-title::before, #loading .u-title::after { width: clamp(32px, 6vw, 72px); }
#loading .title-eyebrow {
  font-family: var(--f-num); font-size: 11px; letter-spacing: 0.44em; color: var(--c-accent-hi);
  text-transform: uppercase; opacity: 0.86; margin-bottom: -6px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}
#loading .track { width: min(360px, 76vw); margin-top: 6px; }
#load-text {
  font-family: var(--f-serif); font-size: var(--fs-sm); color: var(--c-fg-2);
  letter-spacing: 0.16em; font-variant-numeric: tabular-nums; text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
.page-table #err { color: #f0a090; font-size: var(--fs-xs); white-space: pre-wrap; pointer-events: none; }

/* =====================================================================
 * 个人客户端（player.html）· 第一/第三人称探索 HUD
 * ===================================================================== */
.chip {
  display: flex; align-items: center; gap: 9px; height: var(--tap); padding: 0 14px 0 13px; box-sizing: border-box;
  font-size: var(--fs-md); white-space: nowrap; pointer-events: none; min-width: 0; max-width: 100%;
}
.chip #me-name { font-family: var(--f-serif); font-weight: 600; font-size: 15px; letter-spacing: 0.12em; overflow: hidden; text-overflow: ellipsis; min-width: 2em; flex: 0 1 auto; }
.chip .room { color: var(--c-accent-hi); font-family: var(--f-serif); font-size: var(--fs-xs); letter-spacing: 0.12em; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1000 auto; padding-left: 10px; border-left: 1px solid var(--c-line); }
.chip .room:empty { display: none; }
#top-right .u-btn { height: var(--tap); padding: 0 13px; font-size: var(--fs-sm); color: var(--c-fg); }
#t-quality .q { color: var(--c-accent-hi); font-weight: 600; }
@media (max-width: 520px) { .chip .room { display: none; } }

/* 机械黄铜圆章动作键（跳 / 动作 / 视角） */
.round {
  position: absolute; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  pointer-events: auto; touch-action: none; cursor: pointer;
  background: radial-gradient(circle at 50% 24%, rgba(44, 36, 26, 0.86) 0%, rgba(16, 13, 10, 0.9) 72%);
  border: 1.5px solid rgba(212, 177, 114, 0.5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 0 0 3px rgba(10, 8, 6, 0.55), inset 0 0 0 4px rgba(212, 177, 114, 0.2), inset 0 1px 0 rgba(255, 240, 200, 0.22);
  color: var(--c-fg); font-family: var(--f-serif); font-size: var(--fs-2xs); letter-spacing: 0.08em; line-height: 1.2;
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.round span { white-space: nowrap; }
.round .ic { --ic: 21px; color: var(--c-accent-hi); }
#b-jump { font-size: var(--fs-sm); font-weight: 600; border-color: rgba(229, 196, 131, 0.68); }
#b-jump .ic { --ic: 27px; }
#b-view { letter-spacing: 0.02em; }
#b-view .ic { --ic: 18px; }
.round.down {
  border-color: var(--c-accent-hi);
  background: radial-gradient(circle at 50% 40%, rgba(92, 72, 42, 0.92) 0%, rgba(28, 22, 15, 0.95) 80%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 16px rgba(204, 165, 98, 0.35), inset 0 0 0 3px rgba(10, 8, 6, 0.5);
  transform: scale(0.93);
}

/* RPG 切角鎏金互动提示牌（唯一高亮主行动键） */
#b-ia {
  display: none; align-items: center; gap: 10px; height: 50px; padding: 0 22px 0 18px; box-sizing: border-box;
  touch-action: none; cursor: pointer;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  background: linear-gradient(180deg, #ecd095 0%, #c89d54 55%, #b1863f 100%);
  color: var(--c-accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 250, 232, 0.65), inset 0 -2px 0 rgba(70, 48, 18, 0.45);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
  font-family: var(--f-serif); font-size: 16px; font-weight: 700; letter-spacing: 0.14em; white-space: nowrap;
  max-width: calc(100vw - var(--sa-l) - var(--sa-r) - 28px);
  transition: transform var(--t-fast) var(--ease-out), filter var(--t-fast) var(--ease-out);
}
#b-ia.show { display: flex; animation: u-rise 180ms var(--ease-out); }
#b-ia .ic { --ic: 20px; --ic-stroke: 2.1; color: var(--c-accent-ink); }
#b-ia span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#b-ia kbd {
  background: rgba(22, 17, 10, 0.82); color: #f6e4bc; border-color: rgba(22, 17, 10, 0.9);
  font-weight: 700; margin-left: 2px;
}
#b-ia.down { transform: scale(0.95); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)) brightness(1.06); }
@media (max-height: 420px) { #b-ia { height: 46px; font-size: var(--fs-md); padding: 0 16px 0 14px; max-width: calc(100vw - var(--sa-l) - var(--sa-r) - 236px - 240px); } }

/* 动作轮盘面板：黑漆黄铜六格槽 */
#wheel .shade { position: absolute; inset: 0; background: rgba(6, 5, 4, 0.36); animation: u-fade var(--t-fast) var(--ease-out); }
#wheel .panel {
  position: absolute; display: grid; grid-template-columns: repeat(3, 72px); gap: 6px; padding: 10px;
  border-radius: var(--r-xs);
  background:
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 8px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 0 0 / 1px 8px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 8px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 100% 100% / 1px 8px no-repeat,
    linear-gradient(180deg, rgba(24, 20, 15, 0.96) 0%, rgba(13, 11, 9, 0.98) 100%);
  border: 1px solid var(--c-line-hi); box-shadow: var(--sh-2), var(--sh-brass);
  animation: u-rise 170ms var(--ease-out);
}
#wheel .panel button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 66px; padding: 0 2px;
  border: 1px solid var(--c-line-dim); border-radius: var(--r-xs);
  background: linear-gradient(180deg, rgba(255, 245, 220, 0.05) 0%, rgba(255, 245, 220, 0.015) 100%);
  color: var(--c-fg); font-family: var(--f-serif); font-size: var(--fs-xs); letter-spacing: 0.08em;
  cursor: pointer; touch-action: manipulation;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
#wheel .panel button .ic { --ic: 22px; color: var(--c-accent-hi); }
#wheel .panel button span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wheel .panel button kbd { position: absolute; top: 4px; right: 4px; font-size: 10px; height: 15px; min-width: 15px; border-bottom-width: 1px; color: var(--c-fg-3); background: transparent; border-color: var(--c-line); }
#wheel .panel button:active, #wheel .panel button.on { background: var(--c-press); border-color: var(--c-accent); transform: scale(0.95); }
@media (hover: hover) { #wheel .panel button:hover { background: var(--c-hover); border-color: var(--c-line-hi); } }

/* 机械罗盘摇杆 */
#joy {
  border-radius: 50%; pointer-events: none; opacity: 0.68;
  border: 1.5px solid rgba(212, 177, 114, 0.44);
  background:
    /* 四向罗盘刻度 */
    linear-gradient(var(--c-accent), var(--c-accent)) 50% 4px / 1px 7px no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) 50% calc(100% - 4px) / 1px 7px no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) 4px 50% / 7px 1px no-repeat,
    linear-gradient(var(--c-accent), var(--c-accent)) calc(100% - 4px) 50% / 7px 1px no-repeat,
    radial-gradient(circle, rgba(16, 13, 10, 0.45) 0%, rgba(16, 13, 10, 0.22) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.38);
  transition: opacity var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
#joy.active { opacity: 1; transition: none; }
#joy.run { border-color: var(--c-accent-hi); box-shadow: 0 0 18px rgba(204, 165, 98, 0.35); }
#joy .ring { position: absolute; inset: 17%; border-radius: 50%; border: 1px dashed rgba(212, 177, 114, 0.24); }
#knob {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 38% 32%, #fbf4e4 0%, #d2c1a0 72%, #a69069 100%);
  border: 1.5px solid rgba(255, 248, 232, 0.65);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.48), inset 0 0 0 3px rgba(34, 26, 16, 0.16);
}
#joy.run #knob {
  background: radial-gradient(circle at 38% 32%, #fff3cf 0%, var(--c-accent-hi) 65%, var(--c-accent-lo) 100%);
  box-shadow: 0 0 16px rgba(229, 196, 131, 0.65), 0 4px 12px rgba(0, 0, 0, 0.45);
}
#joy-hint { font-family: var(--f-serif); font-size: var(--fs-2xs); letter-spacing: 0.14em; color: var(--c-fg-2); white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); pointer-events: none; opacity: 0.78; }

/* 键位提示条 */
.page-player #hint { font-size: var(--fs-xs); color: var(--c-fg-2); text-align: center; padding: 6px 14px; }
.page-player #hint.show { display: flex; }
.page-player #hint i { font-style: normal; color: var(--c-accent); opacity: 0.6; padding: 0 0.45em; }
.page-player #hint span { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
#toast { text-align: center; justify-content: center; font-family: var(--f-serif); }

/* =====================================================================
 * RPG 调查员选人画廊（player.html · #select）
 * 全屏厚涂底图 + 4 张全出血油画立绘塔罗风档案卡
 * ===================================================================== */
#select {
  background:
    radial-gradient(ellipse at 50% 24%, rgba(18, 14, 10, 0.32) 0%, rgba(9, 7, 5, 0.88) 78%, rgba(7, 5, 4, 0.96) 100%),
    url("../img/ui/bg-title.webp") center 34% / cover no-repeat,
    var(--c-bg);
}
#select .title-eyebrow {
  font-family: var(--f-num); font-size: 10px; letter-spacing: 0.42em; color: var(--c-accent-hi);
  opacity: 0.85; margin-bottom: 6px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
#select .u-title { font-size: clamp(22px, 3.6vw, 32px); }
#select .sub { margin: 8px 0 22px; }

#cards { gap: 16px; max-width: 960px; }

.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  padding: 16px 15px 12px; min-height: 360px; box-sizing: border-box;
  border-radius: var(--r-xs);
  background: #14110d;
  border: 1px solid rgba(212, 177, 114, 0.34);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(255, 240, 200, 0.08);
  color: inherit; text-align: left; cursor: pointer; touch-action: manipulation;
  transition: border-color 180ms var(--ease-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
  animation: card-enter 260ms var(--ease-out) backwards;
}
.card:nth-child(1) { animation-delay: 20ms; }
.card:nth-child(2) { animation-delay: 65ms; }
.card:nth-child(3) { animation-delay: 110ms; }
.card:nth-child(4) { animation-delay: 155ms; }

/* 全出血专属角色立绘层 */
.card::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center 14%; background-repeat: no-repeat;
  transition: transform 360ms var(--ease-out), filter 220ms var(--ease-out);
}
.card[data-id="frieren"]::before { background-image: url("../img/ui/portrait-frieren.webp"); }
.card[data-id="kondo"]::before   { background-image: url("../img/ui/portrait-kondo.webp"); }
.card[data-id="zenon"]::before   { background-image: url("../img/ui/portrait-zenon.webp"); }
.card[data-id="amamiya"]::before { background-image: url("../img/ui/portrait-amamiya.webp"); }

/* 底部丝绒渐暗 + 四角精致黄铜框线 */
.card::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 7px 7px / 9px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) 7px 7px / 1px 9px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) calc(100% - 7px) 7px / 9px 1px no-repeat,
    linear-gradient(var(--c-accent-hi), var(--c-accent-hi)) calc(100% - 7px) 7px / 1px 9px no-repeat,
    linear-gradient(180deg, rgba(12, 10, 8, 0.04) 0%, rgba(12, 10, 8, 0.14) 44%, rgba(12, 10, 8, 0.84) 68%, rgba(10, 8, 6, 0.97) 100%);
}
.card > * { position: relative; z-index: 2; }

.card .stripe { position: absolute; left: 0; right: 0; top: 0; height: 3px; opacity: 0.95; z-index: 3; }
.card .name {
  display: flex; align-items: center; gap: 9px; margin-top: auto;
  font-family: var(--f-serif); font-size: 22px; font-weight: 700; letter-spacing: 0.14em;
  color: #faf3e4; white-space: nowrap; min-width: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
.card .name > span:last-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .role {
  font-family: var(--f-serif); font-size: var(--fs-xs); letter-spacing: 0.18em;
  color: var(--c-accent-hi); opacity: 0.95;
}
.card .desc {
  flex: 0 0 auto; font-size: var(--fs-xs); line-height: 1.55; color: var(--c-fg-2);
  margin: 3px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .state {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-height: 36px; margin-top: 4px; padding-top: 8px;
  border-top: 1px solid rgba(212, 177, 114, 0.24);
  font-family: var(--f-serif); font-size: var(--fs-sm); letter-spacing: 0.1em;
}
.card .state span { white-space: nowrap; }
.card .free { color: #a4cf9b; font-weight: 600; }
.card .taken { color: #e29d87; }
.card .mine { color: var(--c-accent-hi); font-weight: 600; }
.card .grab {
  appearance: none; border: 1px solid rgba(226, 157, 135, 0.55);
  background: rgba(166, 65, 45, 0.26); color: #fbd2c4;
  font-family: var(--f-serif); font-size: var(--fs-xs); letter-spacing: 0.1em;
  min-height: 34px; min-width: 56px; padding: 0 11px; border-radius: var(--r-xs);
  cursor: pointer; touch-action: manipulation; white-space: nowrap;
}
.card.is-taken::before { filter: grayscale(0.55) brightness(0.7); }
.card:not(.is-taken):active { transform: translateY(1px) scale(0.985); border-color: var(--c-accent-hi); }
@media (hover: hover) {
  .card:not(.is-taken):hover {
    border-color: var(--c-accent-hi);
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(229, 196, 131, 0.45), 0 0 26px rgba(204, 165, 98, 0.22);
  }
  .card:not(.is-taken):hover::before { transform: scale(1.045); }
}
.card.busy { pointer-events: none; opacity: 0.6; }

#sel-status {
  margin-top: 18px; min-height: 18px; font-family: var(--f-serif); font-size: var(--fs-sm);
  letter-spacing: 0.16em; color: var(--c-fg-2); text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
#sel-load { margin-top: 12px; flex: none; }

@media (max-width: 760px) and (min-height: 481px) {
  #cards { gap: 10px; }
  .card { min-height: 256px; padding: 12px 11px 9px; }
  .card .name { font-size: 18px; }
  .card .desc { -webkit-line-clamp: 2; font-size: 11px; }
}
@media (max-height: 480px) {
  #select .title-eyebrow { display: none; }
  #select .u-title { font-size: var(--fs-xl); }
  #select .sub { margin: 4px 0 10px; font-size: var(--fs-xs); }
  .card { min-height: 196px; padding: 10px 10px 7px; }
  .card .name { font-size: 17px; }
  .card .desc { display: none; }
  .card .state { min-height: 30px; padding-top: 5px; font-size: var(--fs-xs); }
}

/* 精简单行全屏提示条（去 AI 说明书感） */
#a2hs {
  display: none; position: relative; margin: 14px auto 0; box-sizing: border-box;
  padding: 9px 44px 9px 14px; border-radius: var(--r-xs);
  background: rgba(18, 15, 11, 0.86); border: 1px solid var(--c-line);
  font-size: var(--fs-xs); line-height: 1.5; text-align: center; color: var(--c-fg-2);
}
#a2hs.show { display: block; }
#a2hs b { color: var(--c-accent-hi); font-family: var(--f-serif); font-weight: 600; margin-right: 0.4em; }
#a2hs .k { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--r-xs); background: rgba(212, 177, 114, 0.1); border: 1px solid var(--c-line); color: var(--c-fg); white-space: nowrap; }
#a2hs .k .ic { --ic: 13px; color: var(--c-accent-hi); }
#a2hs .arr { color: var(--c-accent); padding: 0 4px; }
#a2hs .u-close { right: 0; top: 50%; transform: translateY(-50%); }

/* 抢座确认框 */
#confirm .box { padding: 24px 22px 18px; }
#confirm p { margin: 0 0 20px; font-family: var(--f-serif); font-size: 15px; line-height: 1.7; color: var(--c-fg); }
#confirm .row { display: flex; gap: 10px; justify-content: flex-end; }

.bubble.pop { animation: u-rise var(--t-base) var(--ease-out); }
.page-player #err { color: #f0a090; font-size: var(--fs-xs); white-space: pre-wrap; pointer-events: none; }

/* =====================================================================
 * 移动触屏强制横屏引导遮罩（iOS Safari 等不支持 orientation.lock 的浏览器兜底）
 * 横屏瞬间纯 CSS 自动消失，不打断后台资源加载；?portrait=1 可临时关闭供调试。
 * ===================================================================== */
#rotate-lock {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 95;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sa-t) + 24px) calc(var(--sa-r) + 24px) calc(var(--sa-b) + 24px) calc(var(--sa-l) + 24px);
  background: radial-gradient(ellipse at 50% 42%, rgba(28, 22, 16, 0.96) 0%, rgba(10, 8, 6, 0.99) 76%);
  text-align: center;
}
#rotate-lock .rl-card {
  width: min(320px, 86vw);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#rotate-lock .rl-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent-hi);
}
#rotate-lock .rl-icon svg {
  width: 44px;
  height: 44px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: rl-turn 2.4s var(--ease-out) infinite;
}
@keyframes rl-turn {
  0%, 18% { transform: rotate(0deg); }
  52%, 78% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
#rotate-lock .rl-eyebrow {
  font-family: var(--f-serif);
  font-size: var(--fs-2xs);
  letter-spacing: 0.28em;
  color: var(--c-accent);
  text-transform: uppercase;
}
#rotate-lock .rl-title {
  margin: 0;
  font-family: var(--f-serif);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--c-fg);
}
#rotate-lock .rl-desc {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--c-fg-2);
}
@media (pointer: coarse) and (orientation: portrait) {
  html:not(.allow-portrait) #rotate-lock { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  #rotate-lock .rl-icon svg { animation: none; transform: rotate(-90deg); }
}
