.gathering-scene {
  position: absolute; inset: 0; overflow: hidden; isolation: isolate;
  background: #b6c9ac; outline: none; touch-action: manipulation;
  --scene-ink: var(--ink, #142440); --scene-blue: var(--blue, #0757ff);
}
.scene-world { position: absolute; left: 0; top: 0; will-change: transform; cursor: crosshair; }
.scene-ground { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.scene-actor {
  position: absolute; width: 78px; height: 99px; transform-origin: 50% 100%;
  transform: translate(-50%, -100%) scale(var(--scene-actor-scale));
  border: 0; padding: 0; background: transparent; color: #fff; cursor: pointer;
}
.scene-player { pointer-events: none; }
.scene-sprite {
  position: absolute; bottom: 0; left: 0; display: block; width: 78px; height: 99px;
  background-repeat: no-repeat; background-size: 600% 100%; background-position: 0 0;
  image-rendering: pixelated; filter: drop-shadow(0 4px 1px #1d263e55); animation: none;
}
.scene-player .scene-sprite { background-size: 600% 400%; }
.scene-npc .avatar-guide { background-size: contain; background-position: center bottom; width: 64px; left: 7px; }
.scene-name {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 9px; border: 1px solid #fff9; border-radius: 6px;
  background: #192b49ed; font-family: inherit; font-weight: 700; font-size: 13px; line-height: 1.2;
  box-shadow: 0 2px 0 #14244055; pointer-events: none;
}
.scene-npc .scene-name { font-size: 11px; background: #24354bd9; }
.scene-name { font-size: calc(13px / var(--scene-actor-scale)); }
.scene-npc .scene-name { font-size: calc(11px / var(--scene-actor-scale)); }
.scene-foot-ring {
  position: absolute; left: 6px; bottom: -3px; width: 66px; height: 23px;
  border: 3px solid #fff; border-radius: 50%; background: #648aff4d;
  box-shadow: 0 0 0 3px #629dff, 0 0 16px #d7f4ff;
}
.scene-npc::before {
  content: ''; position: absolute; bottom: -1px; left: 12px; width: 54px; height: 13px;
  border-radius: 50%; background: #25374942; filter: blur(2px);
}
.scene-npc[data-interaction="guide"]::before { left: 17px; bottom: -2px; width: 44px; height: 10px; background: #25374959; filter: blur(1px); }
.scene-npc:hover .scene-name, .scene-npc:focus-visible .scene-name { background: #0757ff; }
.scene-npc:focus-visible { outline: 3px dashed #fff; outline-offset: 7px; border-radius: 8px; }
.scene-place {
  position: absolute; z-index: 20; width: 14%; height: 25%; transform: translate(-50%, -50%);
  border: 2px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; pointer-events: none;
}
.scene-place::before { content: ''; position: absolute; inset: 0; pointer-events: auto; }
.scene-place-board::before { clip-path: polygon(0 18%, 84% 6%, 84% 90%, 10% 100%, 0 70%); }
.scene-place-departure::before { clip-path: polygon(9% 4%, 68% 0, 100% 32%, 100% 100%, 11% 100%, 11% 60%, 0 38%); }
.scene-place-cafe { width: 16%; height: 22%; }
.scene-place-departure { width: 20%; height: 31%; }
.scene-place span {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  padding: 6px 12px; border: 2px solid #293b4c; border-radius: 6px;
  background: #fffbeced; color: #142440; box-shadow: 2px 3px 0 #14244040;
  font: inherit; font-weight: 800; font-size: 12px; white-space: nowrap;
  visibility: hidden; opacity: 0; pointer-events: none;
}
.scene-place span::after { content: ' ↗'; color: #0757ff; }
.scene-place:hover span, .scene-place:focus-visible span, .scene-place[data-nearby="true"] span { visibility: visible; opacity: 1; }
.scene-place:focus-visible { outline: 3px dashed #fff; }
.scene-place:focus-visible span { background: #fff2b7; }
.scene-destination {
  position: absolute; z-index: 10; width: 42px; height: 22px; transform: translate(-50%, -50%);
  border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px #ffbb00; background: #ffd84855;
  pointer-events: none;
}
.scene-destination img { position: absolute; bottom: 7px; left: 5px; width: 32px; height: 32px; filter: invert(67%) sepia(97%) saturate(1278%) hue-rotate(358deg) brightness(103%) contrast(105%) drop-shadow(0 1px 0 #fff); }
.scene-minimap {
  position: absolute; z-index: 1000; top: max(18px, env(safe-area-inset-top)); right: max(22px, env(safe-area-inset-right));
  width: 176px; padding: 5px; border: 3px solid #1e3250; border-radius: 13px;
  background: #fffdf0ef; box-shadow: 3px 4px 0 #13264638; pointer-events: auto;
}
.scene-minimap.is-collapsed { width: 112px; }
.scene-minimap-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 6px;
  background: transparent; color: #243d52; font: inherit; font-size: 12px; font-weight: 800;
}
.scene-minimap-toggle:hover { background: #e3eced; }
.scene-minimap-toggle:focus-visible { outline: 3px solid #0757ff; outline-offset: -2px; }
.scene-minimap-chevron { width: 8px; height: 8px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: translateY(2px) rotate(45deg); }
.scene-minimap.is-collapsed .scene-minimap-chevron { transform: translateY(-2px) rotate(225deg); }
.scene-minimap-map { position: relative; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 6px; }
.scene-minimap-map img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-minimap-view { position: absolute; border: 1.5px solid #fff; background: #fff2; box-sizing: border-box; box-shadow: 0 0 0 1px #14244088; }
.scene-minimap-player {
  position: absolute; width: 10px; height: 10px; transform: translate(-50%, -50%);
  border: 2px solid #fff; border-radius: 50%; background: #0757ff; box-shadow: 0 0 0 2px #0757ff66;
}
.scene-minimap-caption { display: block; padding-top: 4px; text-align: center; font-size: 10px; font-weight: 700; color: #243d52; }
.scene-nearby { position: absolute; z-index: 1000; bottom: 72px; left: 50%; transform: translateX(-50%); }
.scene-nearby button {
  padding: 10px 16px; border: 2px solid #192b49; border-radius: 9px; background: #fff9db;
  color: #142440; box-shadow: 3px 4px 0 #14244050; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.scene-nearby button:focus-visible { outline: 3px solid #0757ff; outline-offset: 3px; }
.scene-help {
  position: absolute; z-index: 1000; left: 50%; bottom: 21px; transform: translateX(-50%);
  margin: 0; padding: 9px 16px; border: 1px solid #ffffff80; border-radius: 9px;
  color: #fff; background: #192b49dc; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none;
}
.scene-dpad { display: none; position: absolute; z-index: 1000; right: max(22px, env(safe-area-inset-right)); bottom: 103px; width: 142px; height: 94px; }
.scene-dpad button {
  position: absolute; width: 44px; height: 44px; padding: 0; border: 2px solid #25334e;
  border-radius: 8px; background: #fffcf1e6; color: #142440; box-shadow: 2px 3px 0 #14244050;
  font: 800 24px/1 sans-serif; touch-action: none; user-select: none;
}
.scene-dpad button:active { background: #d5e8ff; box-shadow: none; }
.scene-dpad [data-direction="up"] { top: 0; left: 49px; }
.scene-dpad [data-direction="left"] { top: 49px; left: 0; }
.scene-dpad [data-direction="down"] { top: 49px; left: 49px; }
.scene-dpad [data-direction="right"] { top: 49px; left: 98px; }
.scene-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gathering-scene [hidden] { display: none !important; }
@media (pointer: coarse) { .scene-dpad { display: block; } }
@media (max-height: 560px) and (orientation: landscape) {
  .scene-minimap { top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 112px; padding: 3px; border-width: 2px; border-radius: 8px; }
  .scene-minimap-caption { font-size: 8px; padding-top: 2px; }
  .scene-help { bottom: 10px; padding: 6px 10px; font-size: 10px; }
  .scene-nearby { bottom: 48px; }
  .scene-nearby button { padding: 7px 11px; font-size: 11px; }
  .scene-dpad { right: 13px; bottom: 89px; }
  .scene-place span { font-size: 10px; padding: 4px 8px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .scene-minimap { top: max(16px, env(safe-area-inset-top)); right: 12px; width: 122px; }
  .scene-help { bottom: 12px; font-size: 10px; }
  .scene-help span { display: none; }
  .scene-nearby { bottom: 56px; }
  .scene-dpad { bottom: 185px; }
}
@media (max-width: 680px) and (orientation: landscape) {
  .scene-help { display: none; }
  .scene-nearby { left: auto; right: 150px; bottom: 12px; transform: none; }
  .scene-nearby button { min-width: 44px; min-height: 44px; font-size: 13px; padding: 7px 11px; }
}
