/* 遊戲地圖 */
body[data-page="gamemap"] { overflow: hidden; }
body[data-page="gamemap"] .al2-footer, body[data-page="gamemap"] footer { display: none; }
.gm { display: flex; flex-direction: column; height: calc(100dvh - var(--gm-top, 104px)); min-height: 420px; }
.gm__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px max(1.5vw, 12px); border-bottom: 1px solid var(--line); background: var(--surface); }
.gm__title { margin: 0; font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.gm__title small { margin-left: 8px; color: var(--faint); font-size: 12px; font-weight: 400; }
.gm__tools { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-left: auto; }
.gm__q { height: 30px; width: 190px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.gm-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.gm__walk[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #111; }

.gm__stage { position: relative; flex: 1; overflow: hidden; background: #070b10; }
.gm__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.gm__stage canvas.is-drag { cursor: grabbing; }
.gm__stage.is-walk canvas { cursor: crosshair; }

.gm__card { position: absolute; left: 12px; bottom: 12px; max-width: min(380px, calc(100% - 80px)); max-height: 45%; overflow: auto; padding: 12px 14px; font-size: 14px; z-index: 3; }
.gm__card b { font-size: 15px; }
.gm .m { color: var(--muted); font-size: 13px; }
.gm__card .chip, .gm__talk .chip { margin-top: 8px; }
.gm__btns { display: flex; flex-wrap: wrap; gap: 6px; }

.gm__list { position: absolute; left: 12px; top: 12px; width: min(340px, calc(100% - 24px)); max-height: calc(100% - 24px); display: flex; flex-direction: column; gap: 6px; padding: 8px; z-index: 6; }
.gm__list input { height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; }
.gm__kinds { flex-wrap: wrap; }
.gm__mlist { overflow: auto; }
.gm__mlist button, .gm__res button { display: flex; justify-content: space-between; gap: 8px; width: 100%; min-height: 38px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.gm__mlist button:hover, .gm__res button:hover, .gm__mlist button[aria-current="true"] { background: var(--accent-soft); }
.gm__mlist small { color: var(--faint); }
.gm__res { position: absolute; right: 12px; top: 12px; width: min(300px, calc(100% - 24px)); max-height: 50%; overflow: auto; padding: 6px; z-index: 5; }

.gm__zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.gm__zoom button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer; }
.gm__zoom [data-fit] { font-size: 14px; }

.gm__tip, .gm__note { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 13px; z-index: 4; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gm__note { top: 46px; background: rgba(120, 60, 0, .85); }

.gm__talk { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); max-height: min(72%, 560px); overflow: auto; padding: 14px 16px; z-index: 7; box-shadow: var(--shadow); }
.gm__talk .hd { display: flex; gap: 12px; align-items: flex-end; }
.gm__talk .hd img, .gm__talk .hd canvas { width: 96px; height: auto; max-height: 120px; object-fit: contain; flex: none; image-rendering: auto; }
.gm__talk .who { font-weight: 700; font-size: 16px; }
.gm__talk .line { font-size: 16px; line-height: 1.6; margin: 8px 0 10px; }
.gm__talk .opt { display: block; width: 100%; text-align: left; min-height: 42px; margin: 6px 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.gm__talk .opt:hover { border-color: var(--accent); }
.gm__talk .cond { border-style: dashed; color: var(--muted); font-size: 14px; }
.gm__talk .act { font-size: 13px; color: var(--muted); border-left: 3px solid var(--accent); padding: 2px 8px; margin: 4px 0; }
.gm__talk .bar { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.gm__talk table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.gm__talk td { padding: 3px 0; }
.gm__talk td:first-child { color: var(--muted); }
.gm__talk td:last-child { text-align: right; }
.gm__talk h3 { margin: 12px 0 4px; font-size: 16px; }
.gm__talk ol { margin: 4px 0 6px; padding-left: 1.4em; }
.gm__mon { display: flex; align-items: center; gap: 8px; }
.gm__mon canvas { width: 48px; height: 48px; flex: none; }

@media (max-width: 760px) {
  .gm__title { max-width: 60vw; font-size: 16px; }
  .gm__tools { margin-left: 0; width: 100%; }
  .gm__tools .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .gm__tools .chip { white-space: nowrap; flex: none; }
  .gm__q { width: 100%; }
  .gm__card { max-height: 38%; right: 64px; max-width: none; }
}
.gm [hidden] { display: none !important; }
