* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #14181f;
  color: #e6edf3;
  overflow: hidden;
}

.layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.sidebar {
  width: 320px;
  min-width: 280px;
  background: #1c222d;
  border-right: 1px solid #2d3646;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  color: #7ee787;
}

.badge {
  background: #2b3545;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel label {
  font-size: 12px;
  color: #8b949e;
}

.row {
  display: flex;
  gap: 6px;
}

input, select, button {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: #e6edf3;
  font-size: 13px;
}

select, input[type="text"] {
  flex: 1;
}

input[type="number"] {
  width: 72px;
}

button {
  cursor: pointer;
}

.btn-primary {
  background: #238636;
  border-color: #2ea043;
}

.btn-danger {
  background: #8e2323;
  border-color: #b93838;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #161b22;
  border: 1px solid #262e3a;
  cursor: pointer;
}

.player-item:hover {
  border-color: #58a6ff;
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  image-rendering: pixelated;
  object-fit: cover;
  background: #0d1117;
}

.player-meta {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-coord {
  font-size: 11px;
  color: #8b949e;
}

.shield-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #1f4d2b;
  color: #7ee787;
}

.map-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #0e1217;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  image-rendering: pixelated;
}

#mapCanvas:active {
  cursor: grabbing;
}

.hud-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 12px;
  background: rgba(13, 17, 23, 0.88);
  border: 1px solid #30363d;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  z-index: 10;
}

.zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.zoom-controls button {
  background: rgba(13, 17, 23, 0.88);
  border: 1px solid #30363d;
  padding: 5px 10px;
  font-weight: 600;
}

.zoom-controls button:hover {
  border-color: #58a6ff;
}

.minimap-panel {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(13, 17, 23, 0.92);
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
  z-index: 10;
}

.minimap-panel[data-mode="hidden"] #minimapCanvas {
  display: none;
}

.minimap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #8b949e;
}

.minimap-coord {
  color: #e6edf3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.minimap-modes {
  display: flex;
  gap: 3px;
}

.minimap-mode-btn {
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.2;
  color: #8b949e;
  border-color: #30363d;
}

.minimap-mode-btn:hover {
  color: #e6edf3;
  border-color: #58a6ff;
}

.minimap-mode-btn.active {
  background: #1f6feb;
  border-color: #388bfd;
  color: #ffffff;
}

#minimapCanvas {
  display: block;
  cursor: crosshair;
  border-radius: 4px;
  border: 1px solid #262e3a;
  background: #0b0f14;
}

.status-text {
  font-size: 12px;
  color: #7ee787;
}

.error-text {
  font-size: 12px;
  color: #f85149;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop--locked {
  background: rgba(11, 15, 20, 0.96);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 300px;
  background: #1c222d;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card h3 {
  margin: 0;
  font-size: 16px;
}
