.map-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 20, 40, 0.95);
  display: none;
  z-index: 900;
}
.map-panel.active {
  display: block;
}
.map-box,
.map-frame {
  position: absolute;
  top: calc(8vh + 30px);
  left: calc(4rem + 20px);
  width: calc(100% - 4rem - 40px);
  height: calc(100% - 8vh - 50px);
}

.map-box {
  overflow: hidden;
  transform: skewY(-4deg);
  transform-origin: top left;
}

.map-content {
  position: relative;
  width: 100%;
  height: 100%;
  transform: skewY(4deg);
  transform-origin: top left;
}

.map-nav {
  position: absolute;
  top: 10px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}
.map-back {
  left: 10px;
  display: none;
}
.map-close {
  right: 10px;
}
.map-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.map-container:active {
  cursor: grabbing;
}
.map-inner {
  position: absolute;
  top: 0;
  left: 0;
  background: #0d1a30;
  transform-origin: 0 0;
}
.map-frame {
  pointer-events: none;
  transform: skewY(-4deg);
  transform-origin: top left;
  z-index: 5;
}
.map-frame .frame-side {
  position: absolute;
}
.map-frame .frame-side span {
  position: absolute;
  background: var(--accent-color);
}
.map-frame .frame-side::before,
.map-frame .frame-side::after {
  content: '';
  position: absolute;
  background: var(--accent-color);
}
.map-frame .frame-side.top {
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
}
.map-frame .frame-side.top::before,
.map-frame .frame-side.top::after {
  height: 2px;
}
.map-frame .frame-side.top::before {
  width: 120%;
  left: -10%;
  top: 0;
  transform: rotate(-2deg);
}
.map-frame .frame-side.top::after {
  width: 30%;
  left: 50%;
  top: 6px;
  transform: rotate(-2deg);
}
.map-frame .frame-side.top span {
  height: 2px;
  transform: rotate(-2deg);
}
.map-frame .frame-side.top span:nth-child(1) {
  width: 80%;
  left: -20%;
  top: 12px;
}
.map-frame .frame-side.top span:nth-child(2) {
  width: 50%;
  left: 40%;
  top: 14px;
}
.map-frame .frame-side.bottom {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
}
.map-frame .frame-side.bottom::before,
.map-frame .frame-side.bottom::after {
  height: 2px;
}
.map-frame .frame-side.bottom::before {
  width: 120%;
  left: -10%;
  bottom: 0;
  transform: rotate(-2deg);
}
.map-frame .frame-side.bottom::after {
  width: 40%;
  left: 10%;
  bottom: 6px;
  transform: rotate(2deg);
}
.map-frame .frame-side.bottom span {
  height: 2px;
  transform: rotate(2deg);
}
.map-frame .frame-side.bottom span:nth-child(1) {
  width: 80%;
  left: 40%;
  bottom: 12px;
}
.map-frame .frame-side.bottom span:nth-child(2) {
  width: 50%;
  left: -10%;
  bottom: 14px;
}
.map-frame .frame-side.left {
  top: 0;
  left: 0;
  width: 20px;
  height: 100%;
}
.map-frame .frame-side.left::before,
.map-frame .frame-side.left::after {
  width: 2px;
  background: var(--accent-color);
}
.map-frame .frame-side.left::before {
  height: 120%;
  top: -10%;
  left: 0;
  transform: rotate(2deg);
}
.map-frame .frame-side.left::after {
  height: 35%;
  top: 40%;
  left: 6px;
  transform: rotate(2deg);
}
.map-frame .frame-side.left span {
  width: 2px;
  transform: rotate(2deg);
}
.map-frame .frame-side.left span:nth-child(1) {
  height: 90%;
  top: -15%;
  left: 12px;
}
.map-frame .frame-side.left span:nth-child(2) {
  height: 40%;
  top: 60%;
  left: 14px;
}
.map-frame .frame-side.right {
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
}
.map-frame .frame-side.right::before,
.map-frame .frame-side.right::after {
  width: 2px;
  background: var(--accent-color);
}
.map-frame .frame-side.right::before {
  height: 120%;
  top: -10%;
  right: 0;
  transform: rotate(-2deg);
}
.map-frame .frame-side.right::after {
  height: 50%;
  top: 20%;
  right: 6px;
  transform: rotate(-2deg);
}
.map-frame .frame-side.right span {
  width: 2px;
  transform: rotate(-2deg);
}
.map-frame .frame-side.right span:nth-child(1) {
  height: 90%;
  top: -15%;
  right: 12px;
}
.map-frame .frame-side.right span:nth-child(2) {
  height: 40%;
  top: 60%;
  right: 14px;
}
.map-circle {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 170, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s;
  transform: translate(-50%, -50%);
}
.map-circle:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

.map-char-icons {
  position: absolute;
  bottom: -10px;
  right: -10px;
  display: flex;
}

.map-char-icons .char-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: -8px;
  border: 2px solid #fff;
}
.map-pin {
  position: absolute;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-bottom: 20px solid red;
  transform: translate(-50%, -100%);
  pointer-events: none;
}
.map-pin::after {
  content: '';
  position: absolute;
  left: -10px;
  top: -30px;
  width: 20px;
  height: 20px;
  background: red;
  border-radius: 50%;
}
.map-controls {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}
.map-controls input {
  width: 100px;
}
.location-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.main-location {
  font-size: 1.4rem;
}
.sub-location {
  font-size: 0.9rem;
  opacity: 0.8;
}

.move-warning {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  animation: fadeMove 1s forwards;
}

@keyframes fadeMove {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
