:root {
  --walk-green: #1b4332;
  --walk-gold: #c9a84c;
  --walk-paper: #f7f5ef;
  --walk-ink: #16201c;
}

.walk-entry[hidden],
.walk-dock[hidden],
.walk-hotspots[hidden],
.walk-point-rail[hidden],
.walk-minimap[hidden] {
  display: none !important;
}

.walk-entry {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  transform: translateX(-50%);
  border: 1px solid rgba(201, 168, 76, 0.72);
  border-radius: 999px;
  background: rgba(27, 67, 50, 0.95);
  padding: 8px 20px 8px 9px;
  color: #fff;
  box-shadow: 0 14px 38px rgba(15, 30, 24, 0.32);
  cursor: pointer;
  transition: opacity 0.25s, transform 0.25s;
}
.walk-entry:hover {
  transform: translateX(-50%) translateY(-2px);
}
.walk-entry.in-panel {
  position: static;
  width: calc(100% - 30px);
  margin: 12px 15px 2px;
  transform: none;
  justify-content: center;
}
.walk-entry.in-panel:hover {
  transform: translateY(-2px);
}
.walk-entry.off {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
}
.walk-entry.in-panel.off {
  transform: translateY(10px);
}
.walk-entry-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--walk-gold);
  color: #2a2308;
  font-size: 22px;
}
.walk-entry strong,
.walk-entry small {
  display: block;
  text-align: left;
}
.walk-entry strong {
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.walk-entry small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 9.5px;
}

.walk-dock {
  position: fixed;
  z-index: 26;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(620px, calc(100vw - 32px));
  min-height: 58px;
  transform: translate(-50%, 22px);
  border: 1px solid rgba(201, 168, 76, 0.44);
  border-radius: 22px;
  background: rgba(27, 67, 50, 0.95);
  padding: 7px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 42px rgba(15, 30, 24, 0.34);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: opacity 0.25s, transform 0.25s;
}
.walk-dock.on {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.walk-dock.is-hidden {
  transform: translate(-50%, calc(100% - 8px));
  pointer-events: none;
}
.walk-mode-switch {
  display: flex;
  flex: 1 1 220px;
  min-width: 0;
  padding: 3px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.09);
}
.walk-mode-switch button {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.walk-mode-switch button.on {
  background: var(--walk-gold);
  color: #2a2308;
}
.walk-tool {
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.walk-tool span {
  display: block;
  margin-top: -2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 8px;
  line-height: 1;
}
.walk-exit {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--walk-gold);
  padding: 0 15px;
  color: #2a2308;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}
.walk-room-status {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(27, 67, 50, 0.87);
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 9px;
  white-space: nowrap;
  pointer-events: none;
}
.walk-key-help {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 33px);
  display: none;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: 999px;
  background: rgba(247, 245, 239, 0.94);
  padding: 5px 10px;
  color: var(--walk-green);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(15, 30, 24, 0.14);
  pointer-events: none;
}
.walk-dock.mode-free .walk-key-help {
  display: flex;
}
.walk-key-help span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.walk-key-help kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  border: 1px solid rgba(27, 67, 50, 0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: var(--walk-green);
  font: 700 10px/1 system-ui, sans-serif;
}
.walk-dock-handle {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 20px);
  width: 48px;
  height: 44px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.walk-dock-handle:before {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 48px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--walk-gold);
  content: "";
}
.walk-dock.is-hidden .walk-dock-handle {
  opacity: 1;
  pointer-events: auto;
}

.walk-hotspots {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  pointer-events: none;
}
.walk-hotspots.on {
  display: block;
}
.walk-hotspots.mode-free {
  display: none;
}
body.walk-map-open .walk-hotspots,
body.walk-sun-open .walk-hotspots {
  display: none;
}
.walk-hotspot {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 48px;
  min-height: 48px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(201, 168, 76, 0.6);
  border-radius: 999px;
  background: rgba(247, 245, 239, 0.78);
  padding: 5px 9px 5px 6px;
  color: var(--walk-green);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 7px 20px rgba(15, 30, 24, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s, transform 0.15s;
}
.walk-hotspot:hover {
  transform: translate(-50%, -50%) scale(1.04);
}
.walk-hotspot-dot {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--walk-gold);
  box-shadow:
    0 0 0 2px rgba(27, 67, 50, 0.30),
    0 4px 12px rgba(15, 30, 24, 0.24);
}
.walk-hotspot-dot:after {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(201, 168, 76, 0.56);
  border-radius: 50%;
  content: "";
  animation: walk-hotspot-pulse 1.8s ease-out infinite;
}
.walk-hotspot.is-obstructed {
  background: rgba(247, 245, 239, 0.9);
  box-shadow:
    0 0 0 2px rgba(201, 168, 76, 0.2),
    0 9px 24px rgba(15, 30, 24, 0.18);
}
.walk-hotspot.is-obstructed .walk-hotspot-dot:before {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff6cf;
  content: "";
}
@keyframes walk-hotspot-pulse {
  0% { transform: scale(0.74); opacity: 0; }
  28% { opacity: 0.72; }
  100% { transform: scale(1.28); opacity: 0; }
}

.walk-point-rail {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: min(760px, calc(100vw - 30px));
  transform: translate(-50%, 8px);
  border: 1px solid rgba(201, 168, 76, 0.42);
  border-radius: 16px;
  background: rgba(247, 245, 239, 0.94);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  overflow-x: auto;
  box-shadow: 0 12px 32px rgba(15, 30, 24, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.18s, transform 0.18s;
}
.walk-point-rail.on {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.walk-point-rail-label {
  flex: none;
  padding: 0 5px;
  color: rgba(27, 67, 50, 0.72);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.walk-point-rail button {
  flex: none;
  min-height: 38px;
  border: 1px solid rgba(27, 67, 50, 0.15);
  border-radius: 11px;
  background: #fff;
  padding: 0 11px;
  color: var(--walk-green);
  font-size: 9.5px;
  font-weight: 750;
  cursor: pointer;
}
.walk-point-rail button:hover {
  border-color: var(--walk-gold);
  background: #fffaf0;
}
.walk-point-rail button.is-current {
  background: rgba(27, 67, 50, 0.08);
  color: rgba(27, 67, 50, 0.5);
}
body.walk-map-open .walk-point-rail,
body.walk-sun-open .walk-point-rail {
  display: none;
}

.walk-joystick {
  position: fixed;
  z-index: 23;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  transform: scale(0.86);
  border: 1px solid rgba(201, 168, 76, 0.56);
  border-radius: 50%;
  background: rgba(27, 67, 50, 0.3);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 0.16s, transform 0.16s;
}
.walk-joystick.available {
  transform: scale(0.92);
  opacity: 0.72;
}
.walk-joystick.on {
  transform: scale(1);
  opacity: 1;
}
.walk-joystick:before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  content: "";
}
.walk-joystick:after {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  color: rgba(27, 67, 50, 0.88);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 5px rgba(255, 255, 255, 0.9);
  content: "RUCH";
}
.walk-joystick:not(.touch-capable) {
  display: none;
}
body.walk-map-open .walk-joystick,
body.walk-sun-open .walk-joystick {
  opacity: 0;
  pointer-events: none;
}
.walk-joystick-knob {
  position: absolute;
  left: 27px;
  top: 27px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.88);
  box-shadow: 0 4px 14px rgba(15, 30, 24, 0.22);
}

.walk-minimap {
  position: fixed;
  z-index: 24;
  right: 18px;
  bottom: 92px;
  width: 164px;
  height: 132px;
  transform: translateY(12px);
  border: 1px solid rgba(201, 168, 76, 0.52);
  border-radius: 16px;
  background: rgba(247, 245, 239, 0.92);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 30, 24, 0.18);
  transition: opacity 0.22s, transform 0.22s;
}
.walk-minimap.on {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.walk-minimap-preview {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.walk-minimap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.walk-map-dialog {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 25, 18, 0.5);
  padding: 18px;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.walk-map-dialog[hidden] {
  display: none;
}
.walk-map-card {
  width: min(680px, 94vw);
  max-height: min(760px, 90dvh);
  overflow: auto;
  border: 1px solid rgba(201, 168, 76, 0.5);
  border-radius: 22px;
  background: var(--walk-paper);
  padding: 14px;
  box-shadow: 0 24px 70px rgba(10, 25, 18, 0.33);
}
.walk-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--walk-green);
}
.walk-map-head strong {
  font-family: Georgia, serif;
  font-size: 20px;
}
.walk-map-close {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(27, 67, 50, 0.17);
  border-radius: 50%;
  background: #fff;
  color: var(--walk-green);
  font-size: 24px;
  cursor: pointer;
}
.walk-map-large {
  width: 100%;
  height: auto;
  max-height: 58dvh;
  border: 1px solid rgba(27, 67, 50, 0.1);
  border-radius: 14px;
  background: #fff;
  cursor: crosshair;
}
.walk-map-rooms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 9px;
}
.walk-map-rooms button {
  min-height: 44px;
  border: 1px solid rgba(27, 67, 50, 0.15);
  border-radius: 10px;
  background: #fff;
  color: var(--walk-green);
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

body.mode-walk .inside {
  display: none;
}
body.mode-walk .model-panel {
  display: none;
}
body.mode-walk.walk-sun-open .sun-panel {
  display: block;
}
body.mode-walk:not(.walk-sun-open) .sun-panel {
  display: none;
}

.walk-entry:focus-visible,
.walk-dock button:focus-visible,
.walk-hotspot:focus-visible,
.walk-minimap-preview:focus-visible,
.walk-map-dialog button:focus-visible {
  outline: 3px solid rgba(201, 168, 76, 0.35);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .walk-entry {
    bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 52px;
    width: min(320px, calc(100vw - 28px));
    justify-content: center;
  }
  .walk-entry.in-panel {
    width: calc(100% - 24px);
    margin: 10px 12px 2px;
  }
  .walk-dock {
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
    min-height: 58px;
    border-radius: 18px;
  }
  .walk-mode-switch {
    flex-basis: 150px;
  }
  .walk-mode-switch button {
    padding: 0 6px;
    font-size: 10px;
  }
  .walk-tool {
    min-width: 44px;
  }
  .walk-exit {
    width: 46px;
    padding: 0 5px;
    font-size: 0;
  }
  .walk-exit:after {
    content: "↩";
    font-size: 22px;
    line-height: 1;
  }
  .walk-minimap {
    top: calc(68px + env(safe-area-inset-top));
    right: 10px;
    bottom: auto;
    width: 96px;
    height: 88px;
    border-radius: 13px;
  }
  .walk-hotspot {
    min-width: 48px;
    min-height: 48px;
    max-width: 122px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
  }
  .walk-key-help {
    display: none !important;
  }
  .walk-point-rail {
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 20px);
    border-radius: 14px;
  }
  .walk-point-rail-label {
    position: sticky;
    left: 0;
    z-index: 1;
    align-self: stretch;
    display: grid;
    place-items: center;
    background: rgba(247, 245, 239, 0.97);
  }
  .walk-map-card {
    width: min(94vw, 520px);
    max-height: 88dvh;
    border-radius: 20px;
  }
  .walk-map-rooms {
    grid-template-columns: repeat(2, 1fr);
  }
  body.mode-walk.walk-sun-open .controls-stack {
    top: auto;
    bottom: calc(78px + env(safe-area-inset-bottom));
    max-height: 42dvh;
  }
  body.mode-walk.walk-sun-open .sun-panel {
    border-radius: 18px;
  }
  body.mode-walk.walk-sun-open .walk-minimap {
    display: none;
  }
}

@media (max-width: 360px) {
  .walk-dock {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
    min-height: 104px;
  }
  .walk-mode-switch {
    grid-column: 1 / -1;
    width: 100%;
  }
  .walk-exit {
    width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .walk-entry,
  .walk-dock,
  .walk-minimap,
  .walk-joystick {
    transition-duration: 0.01ms;
  }
  .walk-hotspot-dot:after {
    animation: none;
  }
}
