:root {
  --ink: #f4efe6;
  --dim: #b6ad9f;
  --card: rgba(22, 24, 28, .68);
  --line: rgba(255, 255, 255, .13);
  --ok: #86e08a;
  --warn: #f2c76b;
}

/* ---- 分步攻略指南（右上角）----
   按钮固定在右上角；面板从按钮下方展开，玻璃卡片风格跟 HUD 一致。
   聊天面板在右下角，两者最多视觉上叠一点，指南 z 序更高。 */
#guide-btn {
  position: fixed; top: 14px; right: 14px; z-index: 40;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 12px/1 system-ui, sans-serif; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#guide-btn:hover { border-color: var(--warn); }
#guide-btn.pulse { animation: guide-pulse 1.1s ease 2; }
@keyframes guide-pulse {
  50% { border-color: var(--warn); box-shadow: 0 0 14px rgba(242, 199, 107, .5); }
}
#guide {
  position: fixed; top: 52px; right: 14px; z-index: 40;
  width: min(330px, calc(100vw - 28px));
  max-height: min(66vh, 540px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 12px 14px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .38);
}
#guide header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#guide h3 {
  margin: 0; flex: 1;
  font: 700 13px/1.25 system-ui, sans-serif; color: var(--warn);
}
#guide .gx {
  border: 0; background: none; color: var(--dim);
  font: 700 15px/1 system-ui, sans-serif; cursor: pointer; padding: 2px 4px;
}
#guide .gx:hover { color: var(--ink); }
#guide ol { margin: 0; padding: 0; list-style: none; counter-reset: gs; }
#guide li {
  counter-increment: gs; display: flex; gap: 8px;
  padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .06);
  font: 12.5px/1.5 system-ui, sans-serif; color: var(--dim);
}
#guide li::before {
  content: counter(gs);
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  font: 700 10px/1 system-ui, sans-serif; margin-top: 1px;
}
#guide li.done { color: var(--ok); opacity: .72; }
#guide li.done::before { content: '✓'; border-color: var(--ok); color: var(--ok); }
#guide li.now { color: var(--ink); }
#guide li.now::before {
  border-color: var(--warn); color: var(--warn);
  box-shadow: 0 0 8px rgba(242, 199, 107, .45);
}
#guide li .note { display: block; font-size: 11.5px; color: var(--warn); margin-top: 3px; }
#guide footer {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .06);
  font: 11px/1.45 system-ui, sans-serif; color: var(--dim); opacity: .85;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: #a8d4ea; color: var(--ink);
  font: 13px/1.55 -apple-system, "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
}

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* 气泡层和 HUD 都不吃鼠标事件，拖拽转镜头才不会被挡住 */
#bubbles { position: fixed; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; transform: translate(-50%, -100%);
  max-width: 220px; padding: 6px 11px; border-radius: 11px;
  background: rgba(255, 253, 247, .95); color: #26221c;
  line-height: 1.45; white-space: pre-wrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(255, 253, 247, .95); border-bottom: 0;
}

#hud {
  position: fixed; inset: 0; padding: 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
#hud.away { display: none; }     /* 开场期间左上角什么都不出现 */

/* ---------- 唯一的那张面板 ---------- */
.card {
  width: 262px; max-width: calc(100vw - 28px);
  background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px;
}
#panel header { display: flex; align-items: center; gap: 8px; }
h1 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }

.status {
  margin: 0 0 0 auto; font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .09); color: var(--dim); white-space: nowrap;
}
.status.on { color: var(--ok); }
.status.off { color: var(--warn); }

#fold {
  flex: none; width: 19px; height: 19px; padding: 0; line-height: 1;
  background: none; border: 1px solid var(--line); border-radius: 5px;
  color: var(--dim); font-size: 13px; cursor: pointer;
}
#fold:hover { color: var(--ink); }
#hud.folded #body, #hud.folded #log, #hud.folded #foot, #hud.folded #banner { display: none; }

#quest { list-style: none; margin: 9px 0 0; padding: 0; }
#quest li { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; color: var(--dim); }
#quest li i {
  flex: none; width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--line); transition: background .2s, border-color .2s;
}
#quest li em { font-style: normal; font-size: 11px; opacity: .65; margin-left: auto; }
#quest li.done { color: var(--ink); }
#quest li.done i { background: var(--ok); border-color: var(--ok); }

#copy-prompt {
  margin-top: 9px; width: 100%; background: none; border: 1px solid var(--line);
  color: var(--dim); padding: 5px 10px; border-radius: 6px;
  font-size: 11.5px; font-family: inherit; cursor: pointer;
}
#copy-prompt:hover { color: var(--ink); border-color: rgba(255, 255, 255, .32); }

/* ---------- 提示条、日志、脚注：都不做成卡片，别再堆一屏 ---------- */
#banner {
  margin: 0; width: 262px; max-width: calc(100vw - 28px);
  font-size: 11.5px; line-height: 1.6; color: var(--warn);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
#banner code { background: rgba(0, 0, 0, .35); padding: 1px 4px; border-radius: 4px; }

#log { margin-top: auto; width: 262px; max-width: calc(100vw - 28px); font-size: 11.5px; }
#log div {
  background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 9px; margin-top: 4px; color: var(--dim);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }

#foot {
  margin: 2px 0 0; font-size: 11px; color: rgba(255, 255, 255, .62);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}

/* ---------- 顶部进度条：面板折叠也看得见 ---------- */
#progress {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; pointer-events: none;
}
#progress .pip {
  width: 20px; height: 20px; border-radius: 50%; pointer-events: auto;
  border: 1.5px solid var(--line); color: var(--dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; line-height: 1; user-select: none;
  background: rgba(28, 30, 35, .55); backdrop-filter: blur(10px);
  transition: background .25s, border-color .25s, color .25s;
}
#progress .pip.active { border-color: #e8c15a; color: #e8c15a; animation: pip-pulse 1.6s ease-in-out infinite; }
#progress .pip.done { background: var(--ok); border-color: var(--ok); color: #10231a; }
#progress .link { width: 14px; height: 1.5px; background: var(--line); }
#progress-note {
  margin-left: 6px; font-size: 11px; color: var(--dim); white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
@keyframes pip-pulse { 50% { box-shadow: 0 0 9px rgba(232, 193, 90, .85); } }

/* ---------- 同伴的表达：路牌、提问 ---------- */
#marks { position: fixed; inset: 0; pointer-events: none; }
.mark {
  position: absolute; transform: translate(-50%, -50%);
  padding: 3px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap;
  background: rgba(246, 238, 220, .95); color: #3a3227;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}

.hint { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--dim); }
.hint b { color: var(--ink); }

#underfoot {
  margin: 0; padding: 5px 11px; border-radius: 8px;
  background: var(--card); backdrop-filter: blur(14px); border: 1px solid var(--line);
  font-size: 12px;
}

/* 提问停在画面正下方，离面板远一点，一眼能看见 */
#ask {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: min(440px, calc(100vw - 28px)); pointer-events: auto;
  background: rgba(28, 30, 35, .92); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .4);
  animation: pop .22s ease both;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }
.ask-q { margin: 0 0 9px; font-size: 13.5px; line-height: 1.5; }
.ask-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-row button {
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: var(--ink);
  padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-family: inherit; cursor: pointer;
}
.ask-row button:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.ask-row input {
  flex: 1; min-width: 160px; background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line); color: var(--ink);
  padding: 5px 10px; border-radius: 7px; font-size: 12.5px; font-family: inherit;
}
.ask-row input:focus { outline: none; border-color: rgba(255, 255, 255, .45); }

/* ---------- 液态玻璃（开场字幕用） ---------- */
#glass-filters { position: absolute; width: 0; height: 0; pointer-events: none; }

.glass {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 7px 7px 7px 16px; border-radius: 999px;
  /* 折射发生在这一层：先掰弯背景，再模糊，最后提一点饱和度和亮度 */
  /* 模糊要克制：糊过头就成了磨砂，玻璃的关键是背景还看得见、只是被掰弯了 */
  backdrop-filter: url(#glass-edge) blur(3px) saturate(148%) brightness(1.02);
  background: linear-gradient(rgba(255, 255, 255, .10), rgba(255, 255, 255, .02));
  box-shadow:
    inset 0 1.2px 0 rgba(255, 255, 255, .62),        /* 顶缘受光 */
    inset 0 -1.2px 0 rgba(255, 255, 255, .16),       /* 底缘反射 */
    inset 1.2px 0 0 rgba(255, 255, 255, .26),
    inset -1.2px 0 0 rgba(255, 255, 255, .26),
    inset 0 0 13px rgba(255, 255, 255, .10),         /* 玻璃的厚度 */
    0 10px 30px rgba(0, 0, 0, .34),
    0 2px 8px rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .22);
  isolation: isolate;
}

/* 高光带 */
.glass-sheen {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(78px 26px at 38% -4%,
    rgba(255, 255, 255, .42), rgba(255, 255, 255, .05) 60%, transparent 78%);
}

/* ---------- 开场：标题 + 三步引导 ---------- */
#intro {
  position: fixed; inset: 0; z-index: 10; overflow: hidden; cursor: pointer; user-select: none;
  /* 标题那一镜压一层暗角，字才立得住；引导镜头只在底部留一点，看风景要紧 */
  background: radial-gradient(ellipse at 50% 42%, rgba(8, 16, 34, 0) 38%, rgba(8, 16, 34, .55) 100%);
  transition: opacity .9s ease, background .6s ease;
}
#intro:not([data-step="title"]) {
  background: linear-gradient(rgba(8, 16, 34, .45), rgba(8, 16, 34, 0) 28%);
}
#intro[data-step="back"] { opacity: 0; pointer-events: none; }

#intro-skip {
  position: absolute; top: 14px; right: 14px; padding: 5px 11px; border-radius: 999px;
  background: rgba(20, 22, 26, .55); backdrop-filter: blur(10px);
  border: 1px solid var(--line); color: rgba(255, 255, 255, .78);
  font-size: 11.5px; font-family: inherit; cursor: pointer;
}
#intro-skip:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
#intro-skip kbd {
  font-family: var(--mono, ui-monospace, monospace); font-size: 10px; margin-left: 3px;
  padding: 0 4px; border-radius: 4px; background: rgba(255, 255, 255, .14);
}

#intro-title {
  /* 停在画面上三分之一：灯塔在正中，标题不能压着它 */
  position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%);
  width: max-content; max-width: calc(100vw - 40px); text-align: center;
  transition: opacity .5s ease, transform .5s ease;
}
#intro-title .row { display: flex; align-items: center; justify-content: center; gap: 4px; }
#intro:not([data-step="title"]) #intro-title {
  opacity: 0; transform: translate(-50%, -50%) scale(.92); pointer-events: none;
}
#intro-title .beacon {
  flex: none; width: clamp(60px, 9.5vw, 116px); height: auto; margin-top: -.35em;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .35));
  animation: drop-in .8s cubic-bezier(.2, 1.5, .4, 1) .15s both;
}
/* 标题里的木桥 "A"：比灯塔略宽，和字面底对齐，晚半拍落地 */
#intro-title .bridge {
  flex: none; width: clamp(64px, 9.8vw, 120px); height: auto; margin: 0 -.08em -.12em .04em;
  transform: rotate(-2.5deg);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .35));
  animation: drop-in .8s cubic-bezier(.2, 1.5, .4, 1) .3s both;
}
#intro-title .beacon .rays {
  transform-origin: 60px 30px;
  animation: sweep 3.2s ease-in-out infinite alternate;
}
@keyframes sweep { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-40px) scale(.7); } }

/* 卡通标题：圆体、厚描边、往下挤出一截阴影，再整个歪一点点。
   描边和挤出都用 text-shadow 叠出来——渐变填充配 text-shadow 在 Chrome 里
   阴影会盖到字面上，所以字面就老老实实用一个实色。 */
.toon {
  margin: 0; padding: 0 .12em;
  font-family: "Arial Rounded MT Bold", "Yuanti SC", "YouYuan", "Hiragino Maru Gothic ProN",
    "PingFang SC", "Microsoft YaHei", "Nunito", system-ui, sans-serif;
  font-weight: 900; font-size: clamp(54px, 10.5vw, 128px); line-height: 1.12;
  letter-spacing: .02em; color: #ffdf5e; white-space: nowrap;
  transform: rotate(-2.5deg);
  text-shadow:
    -3px -3px 0 #23335e,  3px -3px 0 #23335e,  -3px 3px 0 #23335e,  3px 3px 0 #23335e,
    -4px 0 0 #23335e,  4px 0 0 #23335e,  0 -4px 0 #23335e,  0 4px 0 #23335e,
    0 7px 0 #23335e, 0 9px 0 #1a2747,
    0 18px 28px rgba(0, 0, 0, .45);
  animation: toon-in .9s cubic-bezier(.2, 1.6, .4, 1) both, bob 3.4s ease-in-out .9s infinite alternate;
}
/* 汉字方块挨着挤成一坨，拉开一点；letter-spacing 会在最后一个字右边也留一份，
   左边补同样的量才居中 */
.toon [data-lang="zh"] { letter-spacing: .16em; padding-left: .16em; }
@keyframes toon-in { from { opacity: 0; transform: rotate(-2.5deg) scale(.55); } }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -6px; } }

#intro-title .sub {
  margin: 18px 0 0; font-size: clamp(15px, 1.9vw, 21px); font-weight: 600;
  color: #fff; letter-spacing: .06em;
  text-shadow: 0 1px 2px rgba(20, 30, 60, .9), 0 3px 12px rgba(0, 0, 0, .55);
  animation: rise .6s ease .55s both;
}

/* 引导字幕：停在画面正上方，一次只露一条；宽度给右上角的「跳过」让开 */
#intro-cap {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  width: min(560px, calc(100vw - 190px)); padding: 9px 16px 9px 9px;
  transition: opacity .35s ease;
}
#intro[data-step="title"] #intro-cap, #intro[data-step="back"] #intro-cap { opacity: 0; }
#intro-cap p { display: none; margin: 0; align-items: center; gap: 12px; width: 100%; }
#intro[data-step="s1"] p[data-shot="s1"],
#intro[data-step="s2"] p[data-shot="s2"],
#intro[data-step="s3"] p[data-shot="s3"] { display: flex; animation: rise .4s ease both; }
#intro-cap b {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #ffdf5e; color: #23335e; font-size: 15px; font-weight: 800;
  box-shadow: 0 2px 0 #23335e, inset 0 1px 0 rgba(255, 255, 255, .6);
}
#intro-cap p > span { font-size: 14.5px; line-height: 1.45; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
#intro-cap q { quotes: none; padding: 1px 6px; border-radius: 5px; background: rgba(255, 223, 94, .22); color: #ffe98a; }

#intro-next {
  position: absolute; left: 50%; top: 76px; transform: translateX(-50%); margin: 0;
  font-size: 11px; color: rgba(255, 255, 255, .62); text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
  animation: blink 1.6s ease-in-out infinite alternate;
}
#intro[data-step="back"] #intro-next { display: none; }
@keyframes blink { to { opacity: .35; } }

/* ------------------------- character creator ------------------------- */
.cr-open {
  margin-left: auto; padding: 2px 9px; border-radius: 7px; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--dim); font: inherit; font-size: 11.5px; white-space: nowrap;
}
.cr-open:hover { color: var(--ink); border-color: rgba(255, 255, 255, .32); }

.cr-overlay {
  position: fixed; inset: 0; z-index: 40; display: flex;
  align-items: center; justify-content: flex-end; padding: 20px;
  background: linear-gradient(to left, rgba(10, 12, 16, .45), transparent 55%);
}
.cr-card {
  width: 320px; max-width: calc(100vw - 40px); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 14px;
}
.cr-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
}
.cr-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.cr-close {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--dim); font-size: 15px; line-height: 1;
}
.cr-close:hover { color: var(--ink); }
.cr-body { overflow-y: auto; padding: 0 14px 14px; }
.cr-sec { margin-top: 12px; }
.cr-sec h3 {
  margin: 0 0 6px; font-size: 10.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .07em; color: var(--dim);
}
.cr-note { margin: 2px 0; font-size: 11.5px; color: var(--dim); font-style: italic; }

.cr-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-sw {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid transparent; outline: 1px solid rgba(255, 255, 255, .18);
}
.cr-sw.on { border-color: var(--ink); outline-color: var(--ink); }

.cr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-chip {
  padding: 3px 10px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 11.5px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--dim);
  text-transform: capitalize;
}
.cr-chip.on { color: #16212b; background: var(--ink); border-color: var(--ink); }
.cr-chip:hover:not(.on) { color: var(--ink); }

.cr-field { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 12px; color: var(--dim); }
.cr-field span { width: 44px; }
.cr-select {
  flex: 1; font: inherit; font-size: 12px; color: var(--ink);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 7px;
  padding: 3px 7px;
}
.cr-select option { color: #16212b; }

.cr-foot { display: flex; gap: 8px; margin-top: 16px; }
.cr-btn {
  flex: 1; padding: 6px 0; border-radius: 9px; cursor: pointer; font: inherit; font-size: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: var(--dim);
}
.cr-btn:hover { color: var(--ink); border-color: rgba(255, 255, 255, .32); }
.cr-btn.primary { color: #16212b; background: var(--ink); border-color: var(--ink); font-weight: 650; }

/* ------------------------- companion chat ------------------------- */
.wt-tag {
  position: fixed; z-index: 30; transform: translate(-50%, -100%);
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(22, 24, 28, .78); backdrop-filter: blur(8px);
  border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 11px; white-space: nowrap;
  transition: opacity .25s; pointer-events: auto;
  animation: wtPulse 2.4s ease-in-out infinite;
}
.wt-tag::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px;
  background: inherit; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
@keyframes wtPulse { 50% { transform: translate(-50%, -108%); } }

.wt-tag.wt-sub {
  padding: 2px 8px; font-size: 10px; color: var(--dim);
  background: rgba(22, 24, 28, .55); animation: none; pointer-events: none;
}

.wt-chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 320px; max-width: calc(100vw - 40px); height: 420px; max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 14px;
}
.wt-chat-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  background: rgba(37, 211, 102, .14); border-bottom: 1px solid var(--line);
}
.wt-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #25d366; color: #0b1f13; font-weight: 700; font-size: 15px;
}
.wt-title { display: flex; flex-direction: column; line-height: 1.25; }
.wt-title b { font-size: 13.5px; }
.wt-title i { font-style: normal; font-size: 10.5px; color: var(--dim); }
.wt-close {
  margin-left: auto; width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--dim); font-size: 15px; line-height: 1;
}
.wt-close:hover { color: var(--ink); }

.wt-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.wt-msg {
  max-width: 85%; padding: 6px 10px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.wt-msg.me {
  align-self: flex-end; color: #0b1f13;
  background: #25d366; border-bottom-right-radius: 4px;
}
.wt-msg.them {
  align-self: flex-start; color: var(--ink);
  background: rgba(255, 255, 255, .09); border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.wt-msg.them.hint { font-size: 11.5px; color: var(--dim); }

.wt-foot {
  display: flex; gap: 6px; padding: 9px 10px;
  border-top: 1px solid var(--line);
}
.wt-input {
  flex: 1; min-width: 0; font: inherit; font-size: 12.5px; color: var(--ink);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px;
}
.wt-input:focus { outline: none; border-color: rgba(37, 211, 102, .6); }
.wt-hint, .wt-mic, .wt-send {
  flex: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .07);
  color: var(--dim); font-size: 14px; line-height: 1;
}
.wt-hint:hover, .wt-mic:hover { color: var(--ink); }
.wt-send { background: #25d366; border-color: #25d366; color: #0b1f13; }
.wt-mic.live { background: #e8553f; border-color: #e8553f; color: #fff; animation: wtPulse2 1s infinite; }
.wt-mic.off { opacity: .4; cursor: default; }
@keyframes wtPulse2 { 50% { opacity: .55; } }

/* ---------- 触屏控制器（touch.js 注入 DOM，只在 body.touch 下显示） ---------- */
#touch-controls { display: none; }
body.touch #touch-controls {
  display: block; position: fixed; inset: 0;
  pointer-events: none;               /* 空白处的事件照旧落到 canvas（转视角） */
  z-index: 38;                        /* 低于聊天面板(40+)，高于 HUD 提示 */
}
.tc-stick {
  position: absolute; pointer-events: auto; touch-action: none;
  left: calc(22px + env(safe-area-inset-left));
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 128px; height: 128px; border-radius: 50%;
  background: rgba(8, 20, 30, 0.30);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .15s;
}
.tc-stick.on { border-color: rgba(255, 255, 255, 0.55); }
.tc-knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px;
  margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.tc-pad {
  position: absolute; pointer-events: none;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 210px; height: 180px;
}
.tc-btn {
  position: absolute; pointer-events: auto; touch-action: none;
  border-radius: 50%; color: #fff; font-weight: 800;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 0;
  font-family: inherit; letter-spacing: .04em;
  transition: transform .08s, filter .12s;
  user-select: none; -webkit-user-select: none;
}
.tc-btn.held { transform: scale(0.93); filter: brightness(1.4); }
.tc-e {
  right: 0; bottom: 0; width: 88px; height: 88px; font-size: 30px;
  background: rgba(255, 209, 102, 0.22);
}
.tc-e.carrying { background: rgba(255, 209, 102, 0.5); border-color: #ffd166; }
.tc-jump {
  right: 100px; bottom: 14px; width: 64px; height: 64px; font-size: 13px;
  background: rgba(120, 200, 255, 0.22);
}
.tc-run {
  right: 12px; bottom: 100px; width: 64px; height: 64px; font-size: 13px;
  background: rgba(150, 255, 180, 0.2);
}
/* 蓄力环：conic-gradient 扫过一圈 = 蓄满（1.1 秒），--c 由 touch.js 每帧写 */
.tc-ring {
  position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(#ffd166 calc(var(--c, 0) * 1turn), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  opacity: 0; transition: opacity .12s;
}
