/* loop.css — 单屏、不滚动、场景即首页。
 * 原则:功能尽量做成浮在世界上的东西,不做成占版面的界面。 */

/* hidden 属性靠 UA 的 [hidden]{display:none} 生效,权重只有 (0,1,0),
 * 下面很多类写了 display,同权重下作者样式会赢 → 必须显式压回去。 */
[hidden] { display: none !important; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --paper: #f4efe3;
  --paper-2: #ebe3d2;
  --ink: #453a2e;
  --ink-2: #6d6151;
  --muted: #94897a;
  --line: #ded2bb;
  --leaf: #6d9a5e;
  --leaf-d: #547c47;
  --alert: #cf6a4f;
  --sheet-h: 78vh;
  --dock-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  background: #211d19;
  color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  position: relative;
  width: 100%; height: 100dvh; max-width: 520px;
  margin: 0 auto;
  overflow: hidden;
  background: #dfd0ad;
}

/* ── 场景 ── */
#room {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
  display: block;
}

/* ── 三叶草药丸 ── */
.clover {
  position: absolute; z-index: 6;
  top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 13px 6px 10px; border: 0; border-radius: 999px;
  background: rgba(28, 24, 20, .5);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  color: #fff; font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.clover-leaf { font-size: 15px; }
.clover-ready {
  width: 7px; height: 7px; border-radius: 50%; background: #8fd07a;
  animation: breathe 2.2s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* ── 屋里 ⇄ 院子:门本身就是按钮 ──
   之前是屏幕左上角一颗「🌿 去院子」的悬浮药丸,和场景是两层皮。
   现在热区贴在院子那扇红门 / 屋里那个沙地洞口上,
   只留一圈很轻的暖光和一个小标签,让人知道那儿能点,但不抢戏。 */
.door-spot {
  position: absolute; z-index: 5;
  transform: translate(-50%, -50%);
  padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.door-spot .ds-glow {
  position: absolute; inset: -6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 189, .62), rgba(255, 226, 160, .16) 62%, transparent 78%);
  animation: doorbreathe 3.8s ease-in-out infinite;
}
.door-spot .ds-tag {
  position: absolute; left: 50%; bottom: -9px;
  transform: translateX(-50%);
  padding: 3px 10px; border-radius: 999px;
  background: rgba(38, 30, 22, .58);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: rgba(255, 248, 236, .95);
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap;
  letter-spacing: .3px;
}
.door-spot:active .ds-glow { animation: none; opacity: 1; transform: scale(1.06); }
@keyframes doorbreathe {
  0%, 100% { opacity: .42; transform: scale(.94); }
  50%      { opacity: .92; transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .door-spot .ds-glow { animation: none; opacity: .6; }
}

/* ── 点猫冒出的一句话 ── */
.whisper {
  position: absolute; z-index: 6; left: 50%; bottom: calc(var(--dock-h) + var(--safe-b) + 26px);
  transform: translateX(-50%);
  max-width: 78%; padding: 9px 17px; border-radius: 999px;
  background: rgba(28, 24, 20, .74);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  color: #fff; font-size: 14px; text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  animation: rise .34s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 9px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── 出门在外 ── */
.away {
  position: absolute; z-index: 5; left: 0; right: 0;
  bottom: calc(var(--dock-h) + var(--safe-b));
  display: flex; align-items: flex-end; gap: 12px;
  padding: 52px 16px 16px;
  background: linear-gradient(to top, rgba(24,20,16,.9), rgba(24,20,16,0));
  pointer-events: none;
}
.away-thumb {
  flex: none; width: 76px; height: 76px; border-radius: 11px;
  background-size: cover; background-position: center;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.away-txt { flex: 1; min-width: 0; color: #fff; }
.away-txt b { display: block; font-size: 17px; text-shadow: 0 1px 5px rgba(0,0,0,.55); }
.away-txt span { font-size: 12.5px; color: rgba(255,255,255,.78); }

/* ── 悬浮底栏 ──
 * z 必须高于遮罩(8)和抽屉(9):抽屉开着时底栏仍要亮着、可点,才能直接互切面板。 */
.dock {
  position: absolute; z-index: 11; left: 0; right: 0; bottom: 0;
  height: calc(var(--dock-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(30, 26, 21, .58);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255,255,255,.1);
}
.dk {
  flex: 1; position: relative; border: 0; background: none; cursor: pointer;
  color: #fff; font: inherit; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  opacity: .82; transition: opacity .15s, transform .12s;
}
.dk:active { transform: scale(.93); }
.dk.on { opacity: 1; }
.dk-i { font-size: 21px; line-height: 1; }
.dk-t { font-size: 10.5px; letter-spacing: .04em; }
.dot {
  position: absolute; top: 9px; right: 50%; margin-right: -20px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--alert);
  box-shadow: 0 0 0 2px rgba(30,26,21,.8);
}

/* ── 上滑抽屉 ── */
.scrim {
  position: absolute; inset: 0; z-index: 8;
  background: rgba(18, 15, 12, .42);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 抽屉停在底栏之上,底栏始终可点 → 三个面板之间可以直接互切,不用先关再开 */
.sheet {
  position: absolute; z-index: 9; left: 0; right: 0;
  bottom: calc(var(--dock-h) + var(--safe-b));
  height: var(--sheet-h);
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.3);
  animation: slideup .26s cubic-bezier(.22,.9,.3,1);
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }

.sheet-h {
  flex: none; position: relative;
  padding: 8px 52px 12px; text-align: center;
  border-bottom: 1px solid var(--line);
}
.grab {
  display: block; width: 38px; height: 4px; border-radius: 2px;
  background: var(--line); margin: 0 auto 9px;
}
.sheet-h h2 { font-size: 16px; font-weight: 700; }
.sheet-x {
  position: absolute; right: 10px; top: 12px;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--paper-2); color: var(--ink-2);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.sheet-b {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 16px 24px;
  overscroll-behavior: contain;
}

/* ── 抽屉内通用件 ── */
.muted { color: var(--muted); }
.grp { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; margin: 18px 0 8px; }
.grp:first-child { margin-top: 0; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 13px; border-radius: 9px; font: inherit; font-size: 13px; cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn.on { background: var(--leaf); border-color: var(--leaf-d); color: #fff; }
.btn.off, .btn:disabled { opacity: .42; }
.btn.go {
  display: block; width: 100%; margin-top: 12px; padding: 13px;
  background: var(--leaf); border-color: var(--leaf-d); color: #fff;
  font-weight: 700; font-size: 15.5px; border-radius: 11px;
}

.bagcard { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; }
.bagrow { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14px; }
.bagnote { font-size: 13px; color: var(--muted); margin-top: 9px; }

.item { display: flex; gap: 11px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-e { font-size: 25px; flex: none; width: 32px; text-align: center; }
.item-m { flex: 1; min-width: 0; }
.item-n { font-weight: 600; font-size: 14.5px; }
.item-d { font-size: 12.5px; color: var(--muted); }
.item-a { display: flex; gap: 6px; flex: none; }

/* 信箱:大图 feed */

/* ── 信箱：按「一趟」分组 ──
 * 地名由分组标题给一次,不再压在每张图上——一趟四张会重复四次。 */
.trip { margin-bottom: 28px; }
.trip-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 2px 9px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.trip-h b { font-size: 17px; }
.trip-h span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ml-new { width: 8px; height: 8px; border-radius: 50%; background: var(--alert); flex: none; }

.mc { margin-bottom: 15px; cursor: pointer; }
.mc-img {
  position: relative; width: 100%; aspect-ratio: 4/3; border-radius: 13px;
  background-size: cover; background-position: center;
  box-shadow: 0 2px 10px rgba(69,58,46,.16);
}
.mc-place {
  position: absolute; left: 12px; bottom: 10px; color: #fff; font-weight: 700; font-size: 16px;
  text-shadow: 0 1px 6px rgba(0,0,0,.65);
}
.mc-new { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 2px #fff; }
.mc-t { font-size: 13px; color: var(--muted); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.ml { display: flex; gap: 11px; align-items: center; background: #fff;
  border: 1px solid var(--line); border-radius: 13px; padding: 13px; margin-bottom: 15px; cursor: pointer; }
.ml-e { font-size: 21px; flex: none; }
.ml-t { flex: 1; min-width: 0; font-size: 14px; }
.ml-t b { display: block; }
.ml-t span { font-size: 12.5px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.empty { text-align: center; padding: 44px 20px; }
.empty-e { font-size: 34px; }
.empty p { color: var(--muted); font-size: 14px; margin-top: 10px; }

.dexgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.dx { background: #fff; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 4px; text-align: center; opacity: .45; }
.dx.got { opacity: 1; }
.dx-e { font-size: 25px; line-height: 1.25; }
.dx-e.img { width: 40px; height: 40px; margin: 0 auto; background-size: contain; background-position: center; background-repeat: no-repeat; }
/* 图鉴格子：统一高度,内容垂直居中。
   原来未解锁的格子里多一段提示文字,行高参差,是排版乱的主因。 */
.dx { display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 92px; }
.dx-n { font-size: 11px; margin-top: 5px; line-height: 1.3; }
/* 未解锁画剪影:看得见轮廓、看不清细节,才有「还差这一件」的收藏感 */
.dx-e.silhouette { filter: brightness(0) saturate(0); opacity: .17; }
.dx.got .dx-e.img { filter: none; opacity: 1; }
.collect-group-head span { font-variant-numeric: tabular-nums; }

.dx-n { font-size: 11px; margin-top: 3px; }

/* ── 自绘图标 ──
 * 有图用图、没图退回 emoji,两种占位尺寸一致,补图标的过程中布局不会跳。 */
.ico {
  display: inline-block; width: 1.55em; height: 1.55em; vertical-align: -.35em;
  background-size: contain; background-position: center; background-repeat: no-repeat;
}
.ico-emoji { line-height: 1.55em; text-align: center; font-size: .95em; background: none; }
.slot-face .ico { width: 88%; height: 88%; vertical-align: 0; }
.slot.multi .slot-face .ico { width: 46%; height: 46%; }
.own-i-e.ico { width: 34px; height: 34px; margin: 0 auto; display: block; }
.own-i-e.ico-emoji { font-size: 25px; line-height: 1.2; }
.item-e .ico { width: 30px; height: 30px; vertical-align: -.2em; }

/* ── 行李桌:整屏仪式 ──
 * 打包是玩家在这个游戏里唯一的杠杆,所以它拿一整屏、有自己的节奏,
 * 而不是和买东西挤在同一个列表里。 */
.panel {
  position: absolute; z-index: 12; inset: 0;
  display: flex; flex-direction: column;
  background: var(--paper);
  animation: panelin .28s cubic-bezier(.22,.9,.3,1);
}
@keyframes panelin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.panel-h {
  flex: none; position: relative; display: flex; align-items: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  border-bottom: 1px solid var(--line);
}
.panel-h h2 { flex: 1; text-align: center; font-size: 16px; font-weight: 700; }
.panel-back {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--paper-2); color: var(--ink); font-size: 22px; line-height: 1;
  cursor: pointer; flex: none;
}
.panel-clover { flex: none; min-width: 34px; text-align: right; font-size: 14px; font-weight: 700; }

.panel-b { flex: 1; overflow-y: auto; padding: 20px 16px 8px; overscroll-behavior: contain; }
.panel-f {
  flex: none; padding: 12px 16px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--paper);
}
.panel-note { font-size: 13px; color: var(--muted); min-height: 1.5em; text-align: center; }
.panel-f .btn.go { margin-top: 8px; }

/* 包 */
.bag { position: relative; max-width: 320px; margin: 0 auto; }
.bag-flap {
  height: 26px; border-radius: 14px 14px 4px 4px;
  background: linear-gradient(#cdbb96, #bda87f);
  border: 1px solid #a8946c;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.06);
}
.bag-mouth {
  display: flex; gap: 10px; justify-content: space-between;
  padding: 18px 14px 20px; margin-top: -4px;
  border: 1px solid #a8946c; border-top: 0;
  border-radius: 4px 4px 16px 16px;
  background: linear-gradient(#e0d2b0, #d3c39c);
  box-shadow: inset 0 6px 12px rgba(120,100,64,.18);
}
.slot {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: 0; background: none; font: inherit; cursor: pointer; padding: 0;
}
.slot-face {
  width: 58px; height: 58px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; line-height: 1;
  background: rgba(255,255,255,.5);
  border: 2px dashed #a8946c; color: #a8946c;
}
.slot.filled .slot-face { border-style: solid; background: #fff; color: var(--ink); }
.slot-tag { font-size: 11px; color: #7d6c48; }
.slot.multi .slot-face { font-size: 20px; letter-spacing: -2px; }

/* 因果预告 */
.fore {
  max-width: 320px; margin: 18px auto 0; padding: 13px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.fore-t { font-size: 11.5px; color: var(--muted); letter-spacing: .05em; }
.fore-l { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.fore-c {
  font-size: 13px; padding: 4px 11px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
}
.fore-c.on { background: #e7f0e2; border-color: #b6cfa9; color: #3f6c33; }
.fore-x { font-size: 14px; color: var(--ink-2); line-height: 1.8; }
/* 留白的那句：不剧透会发生什么，只提醒你决定权不在你手里 */
.fore-q { font-size: 13px; color: var(--muted); margin-top: 9px;
  padding-top: 9px; border-top: 1px dashed var(--line); }

.btn.wide { display: block; width: 100%; margin: 18px 0 4px; padding: 11px;
  font-size: 14px; border-radius: 10px; background: var(--paper-2); }

/* 你有的东西 */
.own-t { margin: 24px 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.own-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 9px; }
.own-i {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 4px 8px; text-align: center; cursor: pointer; font: inherit;
  transition: transform .1s, border-color .15s;
}
.own-i:active { transform: scale(.94); }
.own-i.in { border-color: var(--leaf); background: #f2f8ef; }
.own-i-e { font-size: 25px; line-height: 1.2; }
.own-i-n { font-size: 11.5px; margin-top: 2px; }
.own-i-c {
  position: absolute; top: 5px; right: 6px; font-size: 10px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.own-empty { grid-column: 1/-1; text-align: center; color: var(--muted); font-size: 13.5px; padding: 20px 0; }

/* 飞进包里的那一下 */
.fly {
  position: fixed; z-index: 20; pointer-events: none;
  font-size: 25px; line-height: 1;
  transition: transform .42s cubic-bezier(.35,.7,.4,1), opacity .42s ease-in;
}

/* ── dev ── */
.devbar {
  position: absolute; z-index: 10; left: 0; right: 0;
  bottom: calc(var(--dock-h) + var(--safe-b));
  display: flex; gap: 5px; padding: 6px 8px;
  background: rgba(20,17,14,.82);
}
.mini { flex: 1; border: 1px solid #4b433b; background: #332d27; color: #ddd4c6;
  border-radius: 6px; padding: 5px 2px; font: inherit; font-size: 11px; cursor: pointer; }

/* ── 明信片:满屏沉浸 ── */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(18,15,12,.94);
  display: flex; justify-content: center; }
.modal-in { position: relative; width: 100%; max-width: 520px; }

.pv { position: absolute; inset: 0; overflow: hidden; }
.pv-bg { position: absolute; inset: -34px; background-size: cover; background-position: center;
  filter: blur(30px) brightness(.6); }
.pv-in { position: absolute; inset: 0; display: flex; flex-direction: column; }
.pv-photo-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(50px + env(safe-area-inset-top, 0px)) 0 0; }
.pv-photo { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
/* 本阶段不做图：没有真图时用稳定的渐变占位，尺寸和真图一致，将来直接替换 */
.pv-ph {
  width: min(88%, 420px); aspect-ratio: 4/3; border-radius: 10px;
  display: flex; align-items: flex-end; padding: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.pv-ph span { color: #fff; font-size: 15px; opacity: .82; text-shadow: 0 1px 5px rgba(0,0,0,.5); }
.pv-cap { flex: none; padding: 18px 22px calc(28px + var(--safe-b)); color: #fff;
  background: linear-gradient(to top, rgba(12,10,8,.92), rgba(12,10,8,0)); }
.pv-place { font-size: 22px; font-weight: 700; }
.pv-text { font-size: 14px; line-height: 1.8; margin-top: 7px; color: rgba(255,255,255,.93); }
.pv-friend { font-size: 13px; margin-top: 9px; color: rgba(255,255,255,.8); }
.pv-from { font-size: 12px; margin-top: 11px; color: rgba(255,255,255,.5); }
.pv-x, .pv-nav {
  position: absolute; z-index: 3; border: 0; cursor: pointer;
  background: rgba(0,0,0,.4); color: #fff;
}
.pv-x { top: calc(12px + env(safe-area-inset-top, 0px)); right: 13px;
  width: 36px; height: 36px; border-radius: 50%; font-size: 21px; line-height: 1; }
.pv-nav { top: 50%; transform: translateY(-50%); width: 40px; height: 62px; font-size: 25px; }
.pv-nav.prev { left: 0; border-radius: 0 9px 9px 0; }
.pv-nav.next { right: 0; border-radius: 9px 0 0 9px; }
.pv-nav.off { opacity: .2; pointer-events: none; }
.pv-count { position: absolute; top: calc(20px + env(safe-area-inset-top, 0px)); left: 50%;
  transform: translateX(-50%); color: rgba(255,255,255,.72); font-size: 12.5px; }

/* ── 归来 ── */
.letter { position: absolute; inset: 0; overflow-y: auto; background: var(--paper); }
.letter-hero { position: relative; width: 100%; aspect-ratio: 4/3;
  background-size: cover; background-position: center; }
.letter-hero span { position: absolute; left: 15px; bottom: 12px; color: #fff; font-size: 13px;
  text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.letter-b { padding: 20px 20px calc(30px + var(--safe-b)); }
.letter-t { font-size: 23px; font-weight: 700; }
.letter-x { font-size: 15px; line-height: 1.9; margin-top: 11px; color: var(--ink-2); }
.letter-s { margin-top: 22px; padding-top: 17px; border-top: 1px dashed var(--line); }
/* 带回来的东西：一件一段来历，不是一排标签 */
.gifts { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.gift { display: flex; gap: 12px; align-items: flex-start; }
.gift-e { flex: none; width: 42px; height: 42px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 22px; }
.gift-i { flex: none; width: 42px; height: 42px; border-radius: 10px;
  background-size: cover; background-position: center; border: 1px solid var(--line); }
.gift-t { flex: 1; min-width: 0; }
.gift-t b { display: block; font-size: 15px; }
.gift-t span { display: block; font-size: 13.5px; line-height: 1.75;
  color: var(--ink-2); margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.chip-i { width: 22px; height: 22px; border-radius: 5px; display: inline-block;
  background-size: cover; background-position: center; }

/* ── toast ── */
.toast {
  position: fixed; z-index: 30; left: 50%;
  bottom: calc(var(--dock-h) + var(--safe-b) + 22px);
  transform: translateX(-50%);
  background: rgba(28,24,20,.93); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px;
  max-width: 86%; text-align: center;
  animation: rise .3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 场景气泡：最新进展。之前只有底部一行小字，玩家不点进信箱根本不知道有新消息。 */
/* 主场景里那叠没拆的信 —— 不是一条横幅,是几张摞着的信封,
   坐在场景里而不是压在场景上。原来这里会把正文前 20 字剧透出来,
   拆信就没意义了;现在它只说明「有几封没看」。 */
.bubble {
  position: absolute; z-index: 7; right: 16px;
  top: calc(62px + env(safe-area-inset-top, 0px));
  width: 62px; height: 54px;
  padding: 0; border: 0; background: none;
  font: inherit; color: var(--ink); cursor: pointer;
  animation: bubIn .38s cubic-bezier(.22,.9,.3,1);
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(40, 30, 18, .38));
}
.bubble:active { transform: scale(.95); }
@keyframes bubIn { from { opacity: 0; transform: translateY(-10px) rotate(-6deg); } to { opacity: 1; transform: none; } }

/* 底下那几张,只露一个边,做出「摞着」的厚度 */
.env-s, .env-top {
  position: absolute; left: 50%; top: 50%;
  width: 46px; height: 33px; margin: -17px 0 0 -23px;
  border-radius: 3px; border: 1.5px solid #b39a72;
  background: linear-gradient(#fdf6e6, #f2e6cd);
}
.env-s { transform: translate(calc(var(--i) * 3px), calc(var(--i) * -3.5px)) rotate(calc(var(--i) * -3deg)); }
.env-top {
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 16px; color: #8a6f4c;
  animation: envNudge 3.4s ease-in-out infinite;
}
/* 信封盖:从两个上角折下来的那条 V */
.env-top::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 62%;
  background: linear-gradient(#f7ecd7, #efe0c2);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 1.5px solid #b39a72;
}
@keyframes envNudge {
  0%, 88%, 100% { transform: none; }
  92% { transform: rotate(-5deg); }
  96% { transform: rotate(4deg); }
}
.bub-n {
  position: absolute; right: -4px; top: -6px; z-index: 2;
  min-width: 19px; height: 19px; border-radius: 10px;
  background: var(--alert); color: #fff; font-size: 11px; font-style: normal;
  font-weight: 700; line-height: 19px; text-align: center; padding: 0 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
@media (prefers-reduced-motion: reduce) { .env-top { animation: none; } }
.bub-i { font-size: 21px; flex: none; }
.bub-t { flex: 1; min-width: 0; line-height: 1.35; }
.bub-t b { display: block; font-size: 14px; }
.bub-t span { display: block; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bub-n { flex: none; min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--alert); color: #fff; font-size: 11px; font-style: normal;
  line-height: 20px; text-align: center; padding: 0 6px; }

/* ── 没拆的信 ──
   收信不能等于「一张图直接糊到脸上」。中间要有「你去把它拆开」这个动作,
   信才像信。第一封的邮戳是「？」—— 它去了哪要拆开才知道,那是悬念本身。 */
.env {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 34px 24px 30px;
  animation: envIn .4s cubic-bezier(.22,.9,.3,1);
  cursor: pointer;
}
@keyframes envIn { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
.env-hint { font-size: 14px; color: var(--ink-2); letter-spacing: .5px; }
.env-paper {
  position: relative; width: 232px; height: 154px;
  border-radius: 6px; border: 2px solid #b39a72;
  background: linear-gradient(#fdf7e9, #f1e4c9);
  box-shadow: 0 10px 26px rgba(60, 44, 22, .3);
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 58%;
  background: linear-gradient(#f8eed9, #eee0c0);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 2px solid #b39a72;
}
.env-stamp {
  position: absolute; right: 12px; top: 11px; z-index: 2;
  width: 50px; height: 40px; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 2px dashed #b0704f; border-radius: 3px;
  background: rgba(255, 250, 238, .92);
  transform: rotate(4deg);
}
.env-stamp span { font-size: 14px; font-weight: 700; color: #8f4f36; line-height: 1; }
.env-stamp i { font-size: 8px; font-style: normal; color: #a8846a; letter-spacing: .5px; }
/* 收件人那几条手写线,不写字 —— 写了就等于剧透 */
.env-lines { position: absolute; left: 20px; bottom: 20px; }
.env-lines span {
  display: block; height: 2px; border-radius: 2px;
  background: rgba(150, 124, 88, .4); margin-bottom: 7px;
}
.env-lines span:nth-child(1) { width: 84px; }
.env-lines span:nth-child(2) { width: 108px; }
.env-lines span:nth-child(3) { width: 62px; }
.env-go { min-width: 132px; }

/* 明信片上的「刚到 / 旅途中 · 第 N 天 / 要走了」,让时间线读得懂 */
.pv-arc {
  font-size: 11px; letter-spacing: 1.5px; color: rgba(255,255,255,.72);
  margin-bottom: 5px;
}
.pv-place i { font-style: normal; opacity: .8; font-size: .76em; }
.pv-place i::before { content: "·"; opacity: .55; margin: 0 7px; }

/* 带回来的东西：逐件亮出来。「获得」需要一个专门的瞬间。 */
.reveal { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 24px; }
.rv-head { color: rgba(255,255,255,.86); font-size: 14px; letter-spacing: .1em; }
.rv-list { display: flex; flex-direction: column; gap: 11px; width: 100%; max-width: 340px; }
.rv-card { display: flex; align-items: center; gap: 13px;
  background: var(--paper); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 6px 22px rgba(0,0,0,.34);
  opacity: 0; animation: rvIn .5s cubic-bezier(.2,1.2,.35,1) forwards; }
@keyframes rvIn { from { opacity: 0; transform: translateY(16px) scale(.92); }
  to { opacity: 1; transform: none; } }
.rv-i { flex: none; width: 46px; height: 46px; background-size: contain;
  background-position: center; background-repeat: no-repeat; }
.rv-e { flex: none; width: 46px; text-align: center; font-size: 32px; }
.rv-t { flex: 1; min-width: 0; }
.rv-t b { display: block; font-size: 15.5px; }
.rv-t span { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.65; margin-top: 3px; }
.rv-ok { max-width: 340px; opacity: 0; animation: rvIn .4s ease-out forwards; }

/* 手绘旅行地图。底图是一整幅真画出来的水墨地图(art-direction/travel-map-web.jpg),
   不是几条 CSS 曲线凑的假手绘。上面只叠去过的地方那几面小旗,没去过的完全不出现。 */
.mp { position: relative; width: 100%; aspect-ratio: 3/2; border-radius: 12px;
  overflow: hidden; background: #e9dcbe;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 26px rgba(96, 74, 44, .18); }
.mp-bg { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; }
.mp.is-blank .mp-bg { filter: saturate(.55) brightness(1.06); opacity: .5; }

.mp-route-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mp-route { fill: none; stroke: #8c5a3c; stroke-width: 1.6;
  stroke-dasharray: 3 3.2; stroke-linecap: round; stroke-linejoin: round;
  opacity: .8; vector-effect: non-scaling-stroke; }

.mp-flag { position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
  filter: drop-shadow(0 2px 3px rgba(70, 50, 26, .38)); }
.mp-pole { width: 2px; height: 22px; background: #55402c; border-radius: 1px;
  order: 2; margin-top: -1px; }
.mp-cloth { width: 15px; height: 11px; background: var(--mp-c, #4f7f45);
  order: 1; margin-left: 15px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 34% 50%); border-radius: 1px; }
.mp-name { order: 3; margin-top: 4px; font-size: 11.5px; font-weight: 700;
  color: #3d2f1e; background: rgba(255, 250, 236, .92); padding: 1px 7px;
  border: 1px solid rgba(90, 68, 40, .28);
  border-radius: 999px; white-space: nowrap; }

.mp-empty { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; text-align: center; font-size: 13px; color: #6b5b45;
  line-height: 1.9; background: rgba(248, 243, 230, .55); }
