body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

#game-container svg {
  width: 100vw;
  height: 100vh;
  display: block;
}

#ui-container {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

#ui-container div {
  color: #fff;
  vertical-align: middle;
}

#ui-container div img {
  height: 24px;
}

/* Map Editor Styles */
#map-editor-toolbar {
  font-family: sans-serif;
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.75);
  border-radius: 10px;
  padding: 0.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 60px;
  align-items: center;
}

#map-editor-toolbar button {
  width: 50px;
  height: 50px;
  border: 2px solid #666;
  border-radius: 8px;
  background: #333;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#map-editor-toolbar button:hover {
  transform: scale(1.05);
  border-color: #999;
  background: #444;
}

#map-editor-toolbar button:active {
  transform: scale(0.95);
}

#map-editor-toolbar button.selected {
  border-color: #4caf50;
  background: #2e7d32;
}

#map-editor-toolbar button img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  pointer-events: none;
}

#map-editor-toolbar .export-button {
  margin-top: 10px;
}

/* Map Editor Indicator */
.map-editor-indicator {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(76, 175, 80, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  font-family: sans-serif;
  font-size: 14px;
  z-index: 1001;
  pointer-events: none;
}

.npc-chatbox-text {
  font-family: "Jersey 10", sans-serif;
  font-size: 1.25rem;
  fill: #08301e;
  text-anchor: middle;
}

@media (orientation: portrait) {
  #map-editor-toolbar {
    top: 0;
    left: 0;
    right: 0;
  }
}

/* Chatbox Styles */
.chatbox-container {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chatbox {
  background-image: url("./resources/images/chatbox.gif");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  transform-origin: center bottom;
  /* Scale based on current tile size relative to base 16px */
  transform: scale(calc(var(--tile-size) / 16));
}

.chatbox-text {
  font-family: "Jersey 10", sans-serif;
  color: #08301e;
  text-align: center;
  word-wrap: break-word;
}

/* Orientation-specific styles */
body.landscape .chatbox {
  width: 620px;
  height: 310px;
  padding: 2rem 2.5rem;
  font-size: 1.3rem;
}

body.portrait .chatbox {
  width: 384px; /* 24 tiles * 16px (base tile size) */
  height: 192px; /* 12 tiles * 16px (base tile size) */
  padding: 1rem 2rem;
}

body.portrait #map-editor-toolbar {
  top: 0;
  left: 0;
  right: 0;
}

body.portrait .chatbox-text {
  font-size: 1rem;
}
