/* 冒险小队：全部像素风。字体是 Fusion Pixel 12px（SIL OFL 1.1，见 fonts/OFL.txt），只裁了页面上用到的字 */
@font-face { font-family: 'px'; src: url('fonts/px.woff') format('woff'); font-display: swap; }
:root { --ink: #f4efe2; --line: #2a1a1e; --panel: rgba(28, 18, 30, .88); --gold: #e9b949; --fs: 16px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1f1833; color: var(--ink); font-family: 'px', monospace; font-size: var(--fs); -webkit-font-smoothing: none; }
#view { position: fixed; inset: 0; overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: thin; scrollbar-color: #7a5070 #1f1833; }
#view.panning { cursor: grabbing; }
#view::-webkit-scrollbar { height: 8px; } #view::-webkit-scrollbar-track { background: #1f1833; } #view::-webkit-scrollbar-thumb { background: #7a5070; }
#world { position: relative; height: 100%; overflow: hidden; }
canvas#bg { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
#stage { position: absolute; inset: 0; pointer-events: none; }
.top { position: fixed; left: 16px; top: 14px; z-index: 5; }
.top h1 { margin: 0; font-size: 32px; font-weight: normal; letter-spacing: 2px; text-shadow: 2px 2px 0 var(--line); }
.top .sub { margin: 2px 0 10px; color: #f8d0a0; text-shadow: 2px 2px 0 var(--line); }
.roster { display: flex; gap: 6px; }
.face { width: 52px; height: 52px; padding: 0; border: 2px solid var(--line); background: #4a3048; cursor: pointer; box-shadow: inset 0 0 0 2px #7a5070; overflow: hidden; }
.face span { display: block; width: 100%; height: 100%; image-rendering: auto; background-repeat: no-repeat; }
.face:hover, .face.on { background: #7a4a5a; box-shadow: inset 0 0 0 2px var(--gold); }
.card { position: fixed; left: 16px; top: 140px; z-index: 5; width: min(340px, calc(100vw - 32px)); padding: 10px 12px; background: var(--panel); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--line); line-height: 1.5; }
.card.hidden { display: none; }
.card .x { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; padding: 0; font: inherit; font-size: 20px; line-height: 1; color: var(--ink); background: #4a3048; border: 2px solid var(--line); cursor: pointer; }
.card .x:hover { background: #7a4a5a; }
.card .nm { padding-right: 32px; }
.card .nm { font-size: 24px; color: var(--gold); }
.card .full { color: #cfc6b4; }
.card .facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.card .facts span { padding: 0 6px; background: #4a3048; border: 2px solid var(--line); }
.card p { margin: 6px 0 0; }
.hint { position: fixed; right: 16px; top: 14px; margin: 0; z-index: 5; color: #f8d0a0; text-shadow: 2px 2px 0 var(--line); }

/* 会动的场景道具：篝火、灯笼 */
.decor { position: absolute; image-rendering: pixelated; background-repeat: no-repeat; pointer-events: none; }

/* 小人 */
.pet { position: absolute; left: 0; bottom: 0; pointer-events: auto; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform; }
.pet.held { cursor: grabbing; }
.pet .spr { position: absolute; inset: 0; image-rendering: auto; background-repeat: no-repeat; }
.pet .shadow { position: absolute; left: 25%; right: 25%; bottom: 0; height: 6px; background: rgba(30, 14, 20, .35); }
.pet .tag { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); padding: 0 4px; white-space: nowrap; background: var(--panel); border: 2px solid var(--line); opacity: 0; transition: opacity .15s; pointer-events: none; }
.pet:hover .tag { opacity: 1; }
.pet.ghostly .spr { opacity: .25; }
.say { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; width: max-content; max-width: min(240px, 70vw); padding: 5px 9px 6px; background: var(--panel); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--line); line-height: 1.4; pointer-events: none; z-index: 3; animation: sayIn .15s steps(3); }
.say b { display: block; font-weight: normal; color: var(--gold); margin-bottom: 1px; }
.say.out { opacity: 0; transition: opacity .2s steps(3); }
@keyframes sayIn { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.say::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); }

/* 绝活的特效：都是贴图（public/fx/，tools/fx.py 生成），一排帧靠 background-position 切 */
.fxs { position: absolute; left: 0; bottom: 0; image-rendering: pixelated; background-repeat: no-repeat; pointer-events: none; z-index: 4; }
.fxs.fixed { position: fixed; top: 0; bottom: auto; }
#stage .tarot { animation: tarot 1.9s steps(8) forwards; }
@keyframes tarot { 0% { opacity: 0; translate: 0 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -30px; } }
#stage .ring { opacity: .85; }
.pet .meat { position: absolute; left: 62%; bottom: 30%; z-index: 2; }
.pet.left .meat { left: auto; right: 62%; scale: -1 1; }
.pet .zz { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.pet .zz .fxs { position: absolute; }
.pet .zz .z0, .pet .zz .z1, .pet .zz .z2 { left: 70%; bottom: 70%; opacity: 0; animation: zz 2.4s steps(6) infinite; }
.pet .zz .z1 { animation-delay: .8s; } .pet .zz .z2 { animation-delay: 1.6s; }
.pet .zz .bub { left: 66%; bottom: 46%; }
.pet.left .zz .z0, .pet.left .zz .z1, .pet.left .zz .z2 { left: auto; right: 70%; }
.pet.left .zz .bub { left: auto; right: 66%; scale: -1 1; }
@keyframes zz { from { translate: 0 0; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } to { translate: 12px -36px; opacity: 0; } }
.trail { position: absolute; left: 0; bottom: 0; image-rendering: auto; background-repeat: no-repeat; opacity: .35; pointer-events: none; filter: brightness(1.6); }
.crumb { position: fixed; width: 4px; height: 4px; background: #8a4a2a; z-index: 4; pointer-events: none; }
.crumb.b { background: #d8823e; }

@media (max-width: 700px) {
  :root { --fs: 12px; }
  .top h1 { font-size: 24px; }
  .face { width: 40px; height: 40px; }
  .card { top: 112px; }
  .hint { left: 16px; right: auto; top: auto; bottom: 8px; z-index: 1; }
}
@media (prefers-reduced-motion: reduce) { 